diff options
author | ManeraKai <manerakai@protonmail.com> | 2022-02-04 04:49:18 +0300 |
---|---|---|
committer | ManeraKai <manerakai@protonmail.com> | 2022-02-04 04:49:39 +0300 |
commit | b4fcdf26ead7072f02d29be7e4b26c572dfbbf4a (patch) | |
tree | 67494df1ecaeb4648fd29d05b2d4757e5ef35ce6 /src/pages/background | |
parent | Cleaning and updating the updateInstance func (diff) | |
download | libredirect-b4fcdf26ead7072f02d29be7e4b26c572dfbbf4a.zip |
Added Piped, cleaned code
Signed-off-by: ManeraKai <manerakai@protonmail.com>
Diffstat (limited to 'src/pages/background')
-rw-r--r-- | src/pages/background/background.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/pages/background/background.js b/src/pages/background/background.js index a39af464..caa7444d 100644 --- a/src/pages/background/background.js +++ b/src/pages/background/background.js @@ -77,7 +77,8 @@ browser.tabs.onUpdated.addListener((tabId, changeInfo, _) => { var protocolHost = `${url.protocol}//${url.host}`; var mightyList = []; mightyList.push( - ...youtubeHelper.getRedirects().normal, + ...youtubeHelper.getRedirects().invidious.normal, + ...youtubeHelper.getRedirects().piped.normal, ...twitterHelper.getRedirects().normal, ...instagramHelper.getRedirects().normal, ...redditHelper.getRedirects().libreddit.normal, @@ -101,7 +102,11 @@ browser.pageAction.onClicked.addListener((tab) => { var protocolHost = `${tabUrl.protocol}//${tabUrl.host}`; var newUrl; - if (youtubeHelper.getRedirects().normal.includes(protocolHost)) newUrl = 'https://youtube.com'; + if ( + youtubeHelper.getRedirects().invidious.normal.includes(protocolHost) || + youtubeHelper.getRedirects().piped.normal.includes(protocolHost) + ) + newUrl = 'https://youtube.com'; if (twitterHelper.getRedirects().normal.includes(protocolHost)) newUrl = 'https://twitter.com'; @@ -131,4 +136,5 @@ browser.pageAction.onClicked.addListener((tab) => { if (wikipediaHelper.getRedirects().normal.includes(protocolHost)) newUrl = 'https://wikipedia.com'; if (newUrl) browser.tabs.update({ url: tabUrl.href.replace(protocolHost, newUrl) }); -}); \ No newline at end of file +}); + |