From d81a4b9766cd536231ba5911bda857962480a046 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Sat, 11 Jun 2022 09:57:41 +0300 Subject: Fixing cookies #319 #323 --- src/pages/options/index.html | 4 ++++ src/pages/options/index.js | 9 --------- src/pages/options/widgets/general.js | 7 ++++++- src/pages/options/widgets/general.pug | 6 +++++- 4 files changed, 15 insertions(+), 11 deletions(-) (limited to 'src/pages') diff --git a/src/pages/options/index.html b/src/pages/options/index.html index afd0b0dc..8d19b3a4 100644 --- a/src/pages/options/index.html +++ b/src/pages/options/index.html @@ -67,6 +67,10 @@ +
+

First-party isolation (Enable for Tor)

+ +

diff --git a/src/pages/options/index.js b/src/pages/options/index.js index b6fcf6b8..39f9c8f3 100644 --- a/src/pages/options/index.js +++ b/src/pages/options/index.js @@ -1,12 +1,3 @@ -import youtubeHelper from "../../assets/javascripts/youtube/youtube.js"; -import twitterHelper from "../../assets/javascripts/twitter.js"; -import redditHelper from "../../assets/javascripts/reddit.js"; -import searchHelper from "../../assets/javascripts/search.js"; -import translateHelper from "../../assets/javascripts/translate/translate.js"; -import wikipediaHelper from "../../assets/javascripts/wikipedia.js"; -import tiktokHelper from "../../assets/javascripts/tiktok.js"; - - for (const a of document.getElementById('links').getElementsByTagName('a')) { a.addEventListener('click', e => { const path = a.getAttribute('href').replace('#', ''); diff --git a/src/pages/options/widgets/general.js b/src/pages/options/widgets/general.js index a66e3b47..6fe01b25 100644 --- a/src/pages/options/widgets/general.js +++ b/src/pages/options/widgets/general.js @@ -176,16 +176,21 @@ for (const frontend of generalHelper.allPopupFrontends) } ) +const firstPartyIsolate = document.getElementById('firstPartyIsolate'); +firstPartyIsolate.addEventListener("change", () => browser.storage.local.set({ firstPartyIsolate: firstPartyIsolate.checked })) browser.storage.local.get( [ 'theme', 'autoRedirect', - 'exceptions' + 'exceptions', + 'firstPartyIsolate' ], r => { autoRedirectElement.checked = r.autoRedirect; themeElement.value = r.theme; + firstPartyIsolate.checked = r.firstPartyIsolate; + instanceTypeElement.addEventListener("change", event => { instanceType = event.target.options[instanceTypeElement.selectedIndex].value diff --git a/src/pages/options/widgets/general.pug b/src/pages/options/widgets/general.pug index b7714b7b..ac9f6639 100644 --- a/src/pages/options/widgets/general.pug +++ b/src/pages/options/widgets/general.pug @@ -10,6 +10,10 @@ section#general_page.option-block option(value="light" data-localise="__MSG_light__") Light option(value="dark" data-localise="__MSG_dark__") Dark + .some-block.option-block + h4() First-party isolation (Enable for Tor) + input#firstPartyIsolate(type="checkbox") + .some-block.option-block h4(data-localise="__MSG_autoRedirect__") input#auto-redirect(type="checkbox") @@ -39,7 +43,7 @@ section#general_page.option-block x(data-localise="__MSG_updateInstances__") Update Instances |    - + .buttons.buttons-inline label#import_settings_text.button.button-inline(for="import-settings") -- cgit 1.4.1