diff --git a/src/webui/www/private/addpeers.html b/src/webui/www/private/addpeers.html index 5ef01c2a4..ad645b3d9 100644 --- a/src/webui/www/private/addpeers.html +++ b/src/webui/www/private/addpeers.html @@ -22,8 +22,8 @@ } }); - const hash = new URI().getData("hash"); - if (!hash) + const hash = new URLSearchParams(window.location.search).get("hash"); + if (hash === null) return; $("peers").focus(); diff --git a/src/webui/www/private/addtrackers.html b/src/webui/www/private/addtrackers.html index df84f1443..818f20f09 100644 --- a/src/webui/www/private/addtrackers.html +++ b/src/webui/www/private/addtrackers.html @@ -30,7 +30,7 @@ fetch("api/v2/torrents/addTrackers", { method: "POST", body: new URLSearchParams({ - hash: new URI().getData("hash"), + hash: new URLSearchParams(window.location.search).get("hash"), urls: $("trackersUrls").value }) }) diff --git a/src/webui/www/private/addwebseeds.html b/src/webui/www/private/addwebseeds.html index c03f7687b..c87c17146 100644 --- a/src/webui/www/private/addwebseeds.html +++ b/src/webui/www/private/addwebseeds.html @@ -29,7 +29,7 @@ fetch("api/v2/torrents/addWebSeeds", { method: "POST", body: new URLSearchParams({ - hash: new URI().getData("hash"), + hash: new URLSearchParams(window.location.search).get("hash"), urls: $("urls").value.split("\n").map(w => encodeURIComponent(w.trim())).filter(w => (w.length > 0)).join("|") }) }) diff --git a/src/webui/www/private/confirmfeeddeletion.html b/src/webui/www/private/confirmfeeddeletion.html index bfd19d661..b0f2abe5c 100644 --- a/src/webui/www/private/confirmfeeddeletion.html +++ b/src/webui/www/private/confirmfeeddeletion.html @@ -13,7 +13,6 @@ "use strict"; window.addEventListener("DOMContentLoaded", () => { - const paths = new URI().getData("paths").split("|"); $("cancelBtn").focus(); $("cancelBtn").addEventListener("click", (e) => { e.preventDefault(); @@ -25,7 +24,8 @@ e.stopPropagation(); let completionCount = 0; - paths.forEach((path) => { + const paths = new URLSearchParams(window.location.search).get("paths").split("|"); + for (const path of paths) { fetch("api/v2/rss/removeItem", { method: "POST", body: new URLSearchParams({ @@ -42,7 +42,7 @@ window.parent.qBittorrent.Client.closeFrameWindow(window); } }); - }); + } }); }); diff --git a/src/webui/www/private/confirmruleclear.html b/src/webui/www/private/confirmruleclear.html index 8b562b257..9817d3c1d 100644 --- a/src/webui/www/private/confirmruleclear.html +++ b/src/webui/www/private/confirmruleclear.html @@ -13,8 +13,6 @@ "use strict"; window.addEventListener("DOMContentLoaded", () => { - const rules = new URI().getData("rules").split("|"); - $("cancelBtn").focus(); $("cancelBtn").addEventListener("click", (e) => { e.preventDefault(); @@ -26,7 +24,8 @@ e.stopPropagation(); let completionCount = 0; - rules.forEach((rule) => { + const rules = new URLSearchParams(window.location.search).get("rules").split("|"); + for (const rule of rules) { window.parent.qBittorrent.RssDownloader.modifyRuleState(decodeURIComponent(rule), "previouslyMatchedEpisodes", [], () => { ++completionCount; if (completionCount === rules.length) { @@ -34,7 +33,7 @@ window.parent.qBittorrent.Client.closeFrameWindow(window); } }); - }); + } }); }); diff --git a/src/webui/www/private/confirmruledeletion.html b/src/webui/www/private/confirmruledeletion.html index b47608f00..cf9f7d874 100644 --- a/src/webui/www/private/confirmruledeletion.html +++ b/src/webui/www/private/confirmruledeletion.html @@ -13,8 +13,6 @@ "use strict"; window.addEventListener("DOMContentLoaded", () => { - const rules = new URI().getData("rules").split("|"); - $("cancelBtn").focus(); $("cancelBtn").addEventListener("click", (e) => { e.preventDefault(); @@ -26,7 +24,8 @@ e.stopPropagation(); let completionCount = 0; - rules.forEach((rule) => { + const rules = new URLSearchParams(window.location.search).get("rules").split("|"); + for (const rule of rules) { fetch("api/v2/rss/removeRule", { method: "POST", body: new URLSearchParams({ @@ -43,7 +42,7 @@ window.parent.qBittorrent.Client.closeFrameWindow(window); } }); - }); + } }); }); diff --git a/src/webui/www/private/confirmtrackerdeletion.html b/src/webui/www/private/confirmtrackerdeletion.html index ecf51b3f5..4324f528f 100644 --- a/src/webui/www/private/confirmtrackerdeletion.html +++ b/src/webui/www/private/confirmtrackerdeletion.html @@ -13,9 +13,10 @@ "use strict"; window.addEventListener("DOMContentLoaded", () => { - const host = new URI().getData("host"); - const urls = new URI().getData("urls"); - $("confirmDeleteTrackerText").textContent = "QBT_TR(Are you sure you want to remove tracker %1 from all torrents?)QBT_TR[CONTEXT=TrackersFilterWidget]".replace("%1", `"${host}"`); + const searchParams = new URLSearchParams(window.location.search); + const host = searchParams.get("host"); + + $("confirmDeleteTrackerText").textContent = "QBT_TR(Are you sure you want to remove tracker %1 from all torrents?)QBT_TR[CONTEXT=TrackersFilterWidget]".replace("%1", host); $("cancelBtn").focus(); $("cancelBtn").addEventListener("click", (e) => { @@ -29,7 +30,7 @@ method: "POST", body: new URLSearchParams({ hash: "*", - urls: urls + urls: searchParams.get("urls") }) }) .then((response) => { diff --git a/src/webui/www/private/download.html b/src/webui/www/private/download.html index 5f481a735..ecd1bb6bb 100644 --- a/src/webui/www/private/download.html +++ b/src/webui/www/private/download.html @@ -163,13 +163,10 @@