mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-01-30 23:38:47 +01:00
Show options page on install or update
But only when pageAction is not available (i.e. Fennec)
This commit is contained in:
parent
77e079e5cc
commit
2b92481004
@ -25,8 +25,12 @@
|
||||
"message": "Über diese Seite können Sie die Einstellungen des Add-ons CanvasBlocker verändern.",
|
||||
"description": ""
|
||||
},
|
||||
"installedNotice": {
|
||||
"message": "CanvasBlocker wurde installiert oder aktualisiert. Wenn Sie diese Seite in Zukunft erreichen wollen, erstellen Sie bitte ein Lesezeichen.",
|
||||
"installNotice": {
|
||||
"message": "CanvasBlocker wurde installiert. Wenn Sie diese Seite in Zukunft erreichen wollen, erstellen Sie bitte ein Lesezeichen.",
|
||||
"description": ""
|
||||
},
|
||||
"updateNotice": {
|
||||
"message": "CanvasBlocker wurde aktualisiert. Wenn Sie diese Seite in Zukunft erreichen wollen und noch kein Lesezeichen erstellt ahben, erstellen Sie bitte eines.",
|
||||
"description": ""
|
||||
},
|
||||
|
||||
|
@ -25,8 +25,12 @@
|
||||
"message": "This page provides a way to change the settings of the CanvasBlocker add-on.",
|
||||
"description": ""
|
||||
},
|
||||
"installedNotice": {
|
||||
"message": "CanvasBlocker was installed or updated. If you want to be able to access this page in the future, please bookmark it.",
|
||||
"installNotice": {
|
||||
"message": "CanvasBlocker was installed. If you want to be able to access this page in the future, please bookmark it.",
|
||||
"description": ""
|
||||
},
|
||||
"updateNotice": {
|
||||
"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": ""
|
||||
},
|
||||
|
||||
|
23
lib/main.js
23
lib/main.js
@ -138,8 +138,27 @@
|
||||
}
|
||||
});
|
||||
|
||||
browser.runtime.onInstalled.addListener(function(){
|
||||
message("CanvasBlocker installed");
|
||||
browser.runtime.onInstalled.addListener(function(details){
|
||||
function openOptions(reason){
|
||||
if (
|
||||
!browser.pageAction ||
|
||||
!browser.pageAction.show ||
|
||||
!browser.pageAction.openPopup
|
||||
){
|
||||
browser.tabs.create({
|
||||
url: browser.extension.getURL("options/options.html?" + reason)
|
||||
});
|
||||
}
|
||||
}
|
||||
switch (details.reason){
|
||||
case "install":
|
||||
message("CanvasBlocker installed");
|
||||
openOptions(details.reason);
|
||||
break;
|
||||
case "update":
|
||||
message("CanvasBlocker updated");
|
||||
openOptions(details.reason);
|
||||
}
|
||||
});
|
||||
|
||||
message("end");
|
||||
|
@ -6,7 +6,7 @@ header {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
header .installedNotice {
|
||||
header .bookmarkNotice {
|
||||
margin: 0.5em;
|
||||
padding: 0.5em;
|
||||
border: 1px dotted #880000;
|
||||
|
@ -44,11 +44,15 @@
|
||||
introduction.textContent = browser.i18n.getMessage("optionsIntroduction");
|
||||
head.appendChild(introduction);
|
||||
|
||||
if (window.location.search === "?installed"){
|
||||
let bookmarkingNotice = document.createElement("div");
|
||||
bookmarkingNotice.className = "installedNotice";
|
||||
bookmarkingNotice.textContent = browser.i18n.getMessage("installedNotice");
|
||||
head.appendChild(bookmarkingNotice);
|
||||
if (window.location.search){
|
||||
let noticeName = window.location.search.substr(1).trim() + "Notice";
|
||||
let notice = browser.i18n.getMessage(noticeName);
|
||||
if (notice){
|
||||
let bookmarkingNotice = document.createElement("div");
|
||||
bookmarkingNotice.className = noticeName + " bookmarkNotice";
|
||||
bookmarkingNotice.textContent = notice;
|
||||
head.appendChild(bookmarkingNotice);
|
||||
}
|
||||
}
|
||||
|
||||
document.body.appendChild(head);
|
||||
|
@ -4,6 +4,7 @@ Version 0.4.5:
|
||||
|
||||
new features:
|
||||
- Added way to inspect canvas content in ask mode while being asked
|
||||
- Open options page on install or update if the options page cannot be accessed in another way
|
||||
|
||||
fixes:
|
||||
- prevent possible double faking
|
||||
|
Loading…
x
Reference in New Issue
Block a user