From fbc16cbb896efb327b037448a6707953364be3cb Mon Sep 17 00:00:00 2001 From: SimonBrazell Date: Wed, 13 Jan 2021 10:34:49 +1100 Subject: [PATCH] =?UTF-8?q?Fixes=20#160=20-=20Disable=20search=20redirects?= =?UTF-8?q?=20by=20default=20(sorry...=20=F0=9F=99=82)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/stylesheets/styles.css | 22 ++++++++++++++++++++++ src/pages/background/background.js | 9 ++++++++- src/pages/options/options.html | 2 +- src/pages/popup/popup.html | 6 +++++- 4 files changed, 36 insertions(+), 3 deletions(-) diff --git a/src/assets/stylesheets/styles.css b/src/assets/stylesheets/styles.css index b620072..5079a3c 100644 --- a/src/assets/stylesheets/styles.css +++ b/src/assets/stylesheets/styles.css @@ -514,3 +514,25 @@ hr { background-color: var(--active); border: none; } + +.new-badge { + position: relative; +} + +.new-badge[data-new-badge]:after { + content: "New!"; + position: absolute; + top: -10px; + right: -42px; + font-size: 0.9em; + background: var(--active); + color: white; + width: 35px; + height: 18px; + text-align: center; + line-height: 18px; + border-radius: 25px; + padding: 2px; + box-shadow: 0 0 1px var(--bg-secondary); + font-weight: bold; +} diff --git a/src/pages/background/background.js b/src/pages/background/background.js index d5a1966..9df083b 100644 --- a/src/pages/background/background.js +++ b/src/pages/background/background.js @@ -525,9 +525,16 @@ browser.webRequest.onBeforeRequest.addListener( ); browser.runtime.onInstalled.addListener((details) => { + browser.storage.sync.get(["disableSearchEngine"], (result) => { + if (result.disableSearchEngine === undefined) { + browser.storage.sync.set({ + disableSearchEngine: true, + }); + } + }); if (details.reason === "update") { browser.storage.sync.get( - ["whitelist", "exceptions", "invidiousInstance"], + ["whitelist", "exceptions", "invidiousInstance", "disableSearchEngine"], (result) => { if (result.whitelist) { let whitelist = result.whitelist.map((e) => diff --git a/src/pages/options/options.html b/src/pages/options/options.html index 6473f2f..8dc1eb7 100644 --- a/src/pages/options/options.html +++ b/src/pages/options/options.html @@ -147,7 +147,7 @@ -

+

Search Engine Redirects

diff --git a/src/pages/popup/popup.html b/src/pages/popup/popup.html index 43a4a1a..b34f0c8 100644 --- a/src/pages/popup/popup.html +++ b/src/pages/popup/popup.html @@ -142,7 +142,11 @@ -

+

Search Engine Redirects