From 4f0452cf5f6a9317c1109ae258c0485fade95761 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 24 Nov 2022 09:00:41 +0700 Subject: [PATCH] fix /watch mouseover dl link --- extension/script.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/extension/script.js b/extension/script.js index 8925832..fa9803d 100644 --- a/extension/script.js +++ b/extension/script.js @@ -165,8 +165,14 @@ function buildDlLink(channelContainer) { sendUrl(currentLocation, "download"); }); dlLink.addEventListener("mouseover", e => { - let channelName = channelContainer.querySelector("#text").textContent; - e.target.title = "TA Download: " + channelName; + let subText + if (window.location.pathname == "/watch") { + subText = window.location.href; + } else { + subText = channelContainer.querySelector("#text").textContent; + }; + + e.target.title = "TA Download: " + subText; }); Object.assign(dlLink.style, { filter: "invert()",