From 676662816babca76abe2266fec007473e0b61f98 Mon Sep 17 00:00:00 2001 From: Mike Date: Fri, 10 Jun 2022 23:52:12 +1200 Subject: [PATCH] Reference twitchBlobUrl directly --- chrome/remove_video_ads.js | 11 ++--------- firefox/content.js | 11 ++--------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/chrome/remove_video_ads.js b/chrome/remove_video_ads.js index 0ae1b20..1119f3a 100644 --- a/chrome/remove_video_ads.js +++ b/chrome/remove_video_ads.js @@ -90,7 +90,7 @@ window.Worker = class Worker extends oldWorker { super(twitchBlobUrl); return; } - var jsURL = getWasmWorkerUrl(twitchBlobUrl); + var jsURL = twitchBlobUrl; if (typeof jsURL !== 'string') { super(twitchBlobUrl); return; @@ -215,7 +215,7 @@ window.Worker = class Worker extends oldWorker { } } var currentQualityLS = window.localStorage.getItem('video-quality'); - + lowQuality[qualityToSelect].click(); window.localStorage.setItem('video-quality', currentQualityLS); @@ -257,13 +257,6 @@ window.Worker = class Worker extends oldWorker { } }; -function getWasmWorkerUrl(twitchBlobUrl) { - var req = new XMLHttpRequest(); - req.open('GET', twitchBlobUrl, false); - req.send(); - return req.responseText.split("'")[1]; -} - function hookWorkerFetch() { var realFetch = fetch; fetch = async function(url, options) { diff --git a/firefox/content.js b/firefox/content.js index d585bb9..4ee5b60 100644 --- a/firefox/content.js +++ b/firefox/content.js @@ -118,7 +118,7 @@ function removeVideoAds() { super(twitchBlobUrl); return; } - var jsURL = getWasmWorkerUrl(twitchBlobUrl); + var jsURL = twitchBlobUrl; if (typeof jsURL !== 'string') { super(twitchBlobUrl); return; @@ -243,7 +243,7 @@ function removeVideoAds() { } } var currentQualityLS = window.localStorage.getItem('video-quality'); - + lowQuality[qualityToSelect].click(); window.localStorage.setItem('video-quality', currentQualityLS); @@ -285,13 +285,6 @@ function removeVideoAds() { } }; - function getWasmWorkerUrl(twitchBlobUrl) { - var req = new XMLHttpRequest(); - req.open('GET', twitchBlobUrl, false); - req.send(); - return req.responseText.split("'")[1]; - } - function hookWorkerFetch() { var realFetch = fetch; fetch = async function(url, options) {