mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-08 20:47:11 +03:00
Allow not counting time in private tabs
Closes https://github.com/ajayyy/SponsorBlock/issues/703
This commit is contained in:
@@ -31,6 +31,11 @@ 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())) {
|
||||
optionsElements[i].classList.add("hidden");
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (optionsElements[i].getAttribute("option-type")) {
|
||||
case "toggle": {
|
||||
const option = optionsElements[i].getAttribute("sync-option");
|
||||
@@ -540,3 +545,7 @@ function copyDebugOutputToClipboard() {
|
||||
alert(chrome.i18n.getMessage("copyDebugInformationFailed"));
|
||||
});
|
||||
}
|
||||
|
||||
function isIncognitoAllowed(): Promise<boolean> {
|
||||
return new Promise((resolve) => chrome.extension.isAllowedIncognitoAccess(resolve));
|
||||
}
|
||||
Reference in New Issue
Block a user