mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2024-10-31 18:38:45 +01:00
Added option "Don't show again on update." for options page.
Fixes #227.
This commit is contained in:
parent
34019f2515
commit
cedd2137e2
@ -43,6 +43,10 @@
|
|||||||
"message": "CanvasBlocker wurde aktualisiert. Wenn Sie diese Seite in Zukunft erreichen wollen und noch kein Lesezeichen erstellt haben, erstellen Sie bitte eines.",
|
"message": "CanvasBlocker wurde aktualisiert. Wenn Sie diese Seite in Zukunft erreichen wollen und noch kein Lesezeichen erstellt haben, erstellen Sie bitte eines.",
|
||||||
"description": ""
|
"description": ""
|
||||||
},
|
},
|
||||||
|
"dontShowOptionsOnUpdate":{
|
||||||
|
"message": "Bei Aktualisierung nicht wieder anzeigen.",
|
||||||
|
"description": ""
|
||||||
|
},
|
||||||
"openInTab": {
|
"openInTab": {
|
||||||
"message": "In separatem Tab öffnen",
|
"message": "In separatem Tab öffnen",
|
||||||
"description": ""
|
"description": ""
|
||||||
|
@ -43,6 +43,10 @@
|
|||||||
"message": "CanvasBlocker was updated. If you want to be able to access this page in the future and have not bookmarked it, please bookmark it.",
|
"message": "CanvasBlocker was updated. If you want to be able to access this page in the future and have not bookmarked it, please bookmark it.",
|
||||||
"description": ""
|
"description": ""
|
||||||
},
|
},
|
||||||
|
"dontShowOptionsOnUpdate":{
|
||||||
|
"message": "Don't show again on update.",
|
||||||
|
"description": ""
|
||||||
|
},
|
||||||
"openInTab": {
|
"openInTab": {
|
||||||
"message": "Open in separate tab",
|
"message": "Open in separate tab",
|
||||||
"description": ""
|
"description": ""
|
||||||
|
@ -181,8 +181,12 @@
|
|||||||
openOptions(details.reason);
|
openOptions(details.reason);
|
||||||
break;
|
break;
|
||||||
case "update":
|
case "update":
|
||||||
message("CanvasBlocker updated");
|
settings.onloaded(function(){
|
||||||
openOptions(details.reason);
|
if (!settings.dontShowOptionsOnUpdate){
|
||||||
|
message("CanvasBlocker updated");
|
||||||
|
openOptions(details.reason);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -222,6 +222,10 @@
|
|||||||
name: "displayDescriptions",
|
name: "displayDescriptions",
|
||||||
defaultValue: false
|
defaultValue: false
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "dontShowOptionsOnUpdate",
|
||||||
|
defaultValue: false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "isStillDefault",
|
name: "isStillDefault",
|
||||||
defaultValue: true
|
defaultValue: true
|
||||||
|
@ -13,6 +13,12 @@ header .bookmarkNotice {
|
|||||||
color: #880000;
|
color: #880000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
header .bookmarkNotice .dontShowOptionsOnUpdate {
|
||||||
|
display: block;
|
||||||
|
margin-top: 0.5em;
|
||||||
|
font-size: 0.8em;
|
||||||
|
}
|
||||||
|
|
||||||
.settings {
|
.settings {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-spacing: 0;
|
border-spacing: 0;
|
||||||
|
@ -65,7 +65,30 @@
|
|||||||
let bookmarkingNotice = document.createElement("div");
|
let bookmarkingNotice = document.createElement("div");
|
||||||
bookmarkingNotice.className = noticeName + " bookmarkNotice";
|
bookmarkingNotice.className = noticeName + " bookmarkNotice";
|
||||||
bookmarkingNotice.textContent = notice;
|
bookmarkingNotice.textContent = notice;
|
||||||
|
|
||||||
|
const dontShowAgain = document.createElement("label");
|
||||||
|
dontShowAgain.className = "dontShowOptionsOnUpdate";
|
||||||
|
const dontShowAgainInput = document.createElement("input");
|
||||||
|
dontShowAgainInput.type = "checkbox";
|
||||||
|
settings.onloaded(function(){
|
||||||
|
dontShowAgainInput.checked = settings.dontShowOptionsOnUpdate;
|
||||||
|
});
|
||||||
|
dontShowAgainInput.addEventListener("change", function(){
|
||||||
|
settings.dontShowOptionsOnUpdate = this.checked;
|
||||||
|
});
|
||||||
|
dontShowAgain.appendChild(dontShowAgainInput);
|
||||||
|
dontShowAgain.appendChild(
|
||||||
|
document.createTextNode(
|
||||||
|
browser.i18n.getMessage("dontShowOptionsOnUpdate")
|
||||||
|
)
|
||||||
|
);
|
||||||
|
bookmarkingNotice.appendChild(dontShowAgain);
|
||||||
|
|
||||||
head.appendChild(bookmarkingNotice);
|
head.appendChild(bookmarkingNotice);
|
||||||
|
|
||||||
|
const newUrl = new URL(window.location.href);
|
||||||
|
newUrl.search = "";
|
||||||
|
window.history.pushState({}, "", newUrl.href);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ Version 0.5.3:
|
|||||||
new features:
|
new features:
|
||||||
- display version in options page
|
- display version in options page
|
||||||
- added link to open options page in separate tab
|
- added link to open options page in separate tab
|
||||||
|
- added option "Don't show again on update." for options page
|
||||||
|
|
||||||
fixes:
|
fixes:
|
||||||
- CSP did not work properly for worker-src
|
- CSP did not work properly for worker-src
|
||||||
|
Loading…
Reference in New Issue
Block a user