diff options
author | ManeraKai <manerakai@protonmail.com> | 2022-04-03 13:55:54 +0300 |
---|---|---|
committer | ManeraKai <manerakai@protonmail.com> | 2022-04-03 13:55:54 +0300 |
commit | 0e889c2d4285b3cf1767cb9b8a3957ec5392324d (patch) | |
tree | aee145d37c3edbe969a5d7ef5c9fae1de535e7a6 /src/assets | |
parent | Fixed some branch merging issues. Bump version => 1.6.2 (diff) | |
download | libredirect-0e889c2d4285b3cf1767cb9b8a3957ec5392324d.zip |
Restructured exceptions to behave in another way #164 #161
Diffstat (limited to 'src/assets')
-rw-r--r-- | src/assets/javascripts/helpers/youtube/youtube.js | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/src/assets/javascripts/helpers/youtube/youtube.js b/src/assets/javascripts/helpers/youtube/youtube.js index 9e88eb31..a4b6d38e 100644 --- a/src/assets/javascripts/helpers/youtube/youtube.js +++ b/src/assets/javascripts/helpers/youtube/youtube.js @@ -295,28 +295,6 @@ function setBypassWatchOnYoutube(val) { console.log("bypassWatchOnYoutube: ", bypassWatchOnYoutube) } -let exceptions = { - "url": [], - "regex": [], -}; -const getExceptions = () => exceptions; -function setExceptions(val) { - exceptions = val; - browser.storage.local.set({ youtubeEmbedExceptions: val }) - console.log("youtubeEmbedExceptions: ", val) -} - -function isException(url) { - for (const item of exceptions.url) { - let protocolHost = commonHelper.protocolHost(url); - console.log(item, protocolHost) - if (item == protocolHost) return true; - } - for (const item of exceptions.regex) - if (new RegExp(item).test(url.href)) return true; - return false; -} - let alwaysUsePreferred; function redirect(url, details, initiator) { if (disable) return null; @@ -360,14 +338,6 @@ function redirect(url, details, initiator) { if (!targets.some(rx => rx.test(url.href))) return null; if ( - details.type != "main_frame" && - details.frameAncestors && details.frameAncestors.length > 0 && - isException(new URL(details.frameAncestors[0].url)) - ) { - console.log(`Canceled ${url.href}`, details.frameAncestors[0].url) - return null; - } - if ( bypassWatchOnYoutube && initiator && ( [...redirects.invidious.normal, @@ -664,7 +634,6 @@ async function init() { "youtubeProtocol", - "youtubeEmbedExceptions", "bypassWatchOnYoutube" ], r => { // r = result @@ -703,8 +672,6 @@ async function init() { bypassWatchOnYoutube = r.bypassWatchOnYoutube ?? true; - if (r.youtubeEmbedExceptions) exceptions = r.youtubeEmbedExceptions; - initInvidiousCookies(); resolve(); @@ -882,9 +849,5 @@ export default { setPipedMaterialRedirects, - getExceptions, - setExceptions, - isException, - init, }; \ No newline at end of file |