aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAjay Ramachandran <[email protected]>2021-06-22 15:04:20 -0400
committerAjay Ramachandran <[email protected]>2021-06-22 15:04:20 -0400
commita118d80548f66a89810b6d4c4195d11150e281dd (patch)
treeab4ce8f340be7669e5e849cffae00a12bb2f7d0a
parent930911e2b90d3b74a0358345f9109172dc8ff06b (diff)
downloadSponsorBlock-a118d80548f66a89810b6d4c4195d11150e281dd.tar.gz
SponsorBlock-a118d80548f66a89810b6d4c4195d11150e281dd.zip
Hide invidious options on safari
-rw-r--r--public/options/options.html2
-rw-r--r--src/options.ts3
2 files changed, 3 insertions, 2 deletions
diff --git a/public/options/options.html b/public/options/options.html
index c7a3578b..586cdc6a 100644
--- a/public/options/options.html
+++ b/public/options/options.html
@@ -55,7 +55,7 @@
<br/>
<br/>
- <div option-type="private-text-change" sync-option="invidiousInstances">
+ <div option-type="private-text-change" sync-option="invidiousInstances" no-safari="true">
<div class="option-button trigger-button">
__MSG_addInvidiousInstance__
</div>
diff --git a/src/options.ts b/src/options.ts
index 20a5d244..13a4bfee 100644
--- a/src/options.ts
+++ b/src/options.ts
@@ -31,7 +31,8 @@ async function init() {
const optionsElements = optionsContainer.querySelectorAll("*");
for (let i = 0; i < optionsElements.length; i++) {
- if (optionsElements[i].getAttribute("private-mode-only") === "true" && !(await isIncognitoAllowed())) {
+ if ((optionsElements[i].getAttribute("private-mode-only") === "true" && !(await isIncognitoAllowed()))
+ || (optionsElements[i].getAttribute("no-safari") === "true" && navigator.vendor !== "Apple Computer, Inc.")) {
optionsElements[i].classList.add("hidden");
continue;
}