aboutsummaryrefslogtreecommitdiffstats
path: root/src/assets
diff options
context:
space:
mode:
authorManeraKai <manerakai@protonmail.com>2022-03-02 07:10:00 +0300
committerManeraKai <manerakai@protonmail.com>2022-03-02 07:10:13 +0300
commit40e15e3570f0643ca813259234e2ff2414f080af (patch)
tree447b357a70fc002c55d11c8c3d2418c35f72e690 /src/assets
parentUpdated packages. Bump version to 1.4.6 (diff)
downloadlibredirect-40e15e3570f0643ca813259234e2ff2414f080af.zip
Added a bypass watch on twitter button. Renamed some things
Diffstat (limited to 'src/assets')
-rw-r--r--src/assets/javascripts/helpers/twitter.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/assets/javascripts/helpers/twitter.js b/src/assets/javascripts/helpers/twitter.js
index 992e44f3..3d0fc2e3 100644
--- a/src/assets/javascripts/helpers/twitter.js
+++ b/src/assets/javascripts/helpers/twitter.js
@@ -94,6 +94,14 @@ function setProtocol(val) {
console.log("twitterProtocol: ", val)
}
+let bypassWatchOnTwitter;
+const getBypassWatchOnTwitter = () => bypassWatchOnTwitter;
+function setBypassWatchOnTwitter(val) {
+ bypassWatchOnTwitter = val;
+ browser.storage.local.set({ bypassWatchOnTwitter })
+ console.log("bypassWatchOnTwitter: ", bypassWatchOnTwitter)
+}
+
function redirect(url, initiator) {
if (disable) return null;
@@ -103,6 +111,7 @@ function redirect(url, initiator) {
if (url.pathname.split("/").includes("home")) return null;
if (
+ bypassWatchOnTwitter &&
initiator && (
[...redirects.nitter.normal,
...redirects.nitter.tor,
@@ -176,6 +185,8 @@ async function init() {
protocol = result.twitterProtocol ?? "normal";
+ bypassWatchOnTwitter = result.bypassWatchOnTwitter ?? true;
+
redirects.nitter = dataJson.nitter;
if (result.twitterRedirects) redirects = result.twitterRedirects;
@@ -212,6 +223,9 @@ export default {
getNitterTorCustomRedirects,
setNitterTorCustomRedirects,
+ getBypassWatchOnTwitter,
+ setBypassWatchOnTwitter,
+
getProtocol,
setProtocol,