mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-07-04 20:46:39 +02: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
6 changed files with 44 additions and 12 deletions
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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue