Added t.co for twitter

This commit is contained in:
ManeraKai 2022-03-08 06:36:11 +03:00
parent d22aed5057
commit d99c0c4141
No known key found for this signature in database
GPG Key ID: 5ABC31FFD562E337
2 changed files with 5 additions and 3 deletions

View File

@ -8,7 +8,8 @@ const targets = [
/^https?:\/\/mobile\.twitter\.com/,
/^https?:\/\/pbs\.twimg\.com/,
/^https?:\/\/video\.twimg\.com/,
/^https?:\/\/platform\.twitter\.com\/embed/
/^https?:\/\/platform\.twitter\.com\/embed/,
/^https?:\/\/t\.co/
];
let redirects = {
@ -151,7 +152,8 @@ function redirect(url, initiator) {
else if (url.pathname.split("/").includes("tweets"))
return `${randomInstance}${url.pathname.replace("/tweets", "")}${url.search}`;
else if (url.host == 't.co')
return `${randomInstance}/t.co${url.pathname}`;
else
return `${randomInstance}${url.pathname}${url.search}`;
}

View File

@ -113,7 +113,7 @@ browser.tabs.onUpdated.addListener(
try { url = new URL(changeInfo.url); }
catch (_) { return }
if (youtubeHelper.isPipedorInvidious(url, 'main_frame', 'piped')) youtubeHelper.initPipedLocalStorage(tabId);
if (twitterHelper.isNitter(url, 'main_frame')) newUrl = twitterHelper.initNitterCookies(url);
if (twitterHelper.isNitter(url, 'main_frame')) twitterHelper.initNitterCookies(url);
if (instagramHelper.isBibliogram(url)) instagramHelper.initBibliogramCookies(url);
// if (changeInfo.url && youtubeHelper.isPipedorInvidious(url, 'main_frame', 'pipedMaterial')) youtubeHelper.initPipedMaterialLocalStorage(tabId);
// if (changeInfo.url && youtubeHelper.isUrlPipedorInvidious(changeInfo.url, 'invidious')) youtubeHelper.initInvidiousCookies(tabId);