Fixes #160 - Disable search redirects by default (sorry... 🙂)

This commit is contained in:
SimonBrazell 2021-01-13 10:34:49 +11:00
parent bd783485a8
commit fbc16cbb89
4 changed files with 36 additions and 3 deletions

View File

@ -514,3 +514,25 @@ hr {
background-color: var(--active); background-color: var(--active);
border: none; 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;
}

View File

@ -525,9 +525,16 @@ browser.webRequest.onBeforeRequest.addListener(
); );
browser.runtime.onInstalled.addListener((details) => { 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") { if (details.reason === "update") {
browser.storage.sync.get( browser.storage.sync.get(
["whitelist", "exceptions", "invidiousInstance"], ["whitelist", "exceptions", "invidiousInstance", "disableSearchEngine"],
(result) => { (result) => {
if (result.whitelist) { if (result.whitelist) {
let whitelist = result.whitelist.map((e) => let whitelist = result.whitelist.map((e) =>

View File

@ -147,7 +147,7 @@
<tbody> <tbody>
<tr> <tr>
<td> <td>
<h1 data-localise="__MSG_disableSearchEngine__"> <h1 data-localise="__MSG_disableSearchEngine__" class="new-badge" data-new-badge>
Search Engine Redirects Search Engine Redirects
</h1> </h1>
</td> </td>

View File

@ -142,7 +142,11 @@
<tbody> <tbody>
<tr> <tr>
<td> <td>
<h1 data-localise="__MSG_disableSearchEngine__"> <h1
data-localise="__MSG_disableSearchEngine__"
class="new-badge"
data-new-badge
>
Search Engine Redirects Search Engine Redirects
</h1> </h1>
</td> </td>