mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2024-12-22 12:50:36 +01:00
parent
d35ffe0b70
commit
dd3620cd08
@ -45,6 +45,10 @@
|
||||
|
||||
message("open port to background script");
|
||||
var port = browser.runtime.connect();
|
||||
if (window === window.top){
|
||||
message("Is top level window -> tab had navigation -> clear page action");
|
||||
port.postMessage({"canvasBlocker-clear-page-action": true});
|
||||
}
|
||||
var tabId;
|
||||
port.onMessage.addListener(function(data){
|
||||
message("Got data from port", data);
|
||||
|
11
lib/main.js
11
lib/main.js
@ -64,6 +64,10 @@
|
||||
browser.pageAction.show(port.sender.tab.id);
|
||||
}
|
||||
}
|
||||
if (data.hasOwnProperty("canvasBlocker-clear-page-action")){
|
||||
notice("Hide page action for tab", port.sender.tab.id);
|
||||
browser.pageAction.hide(port.sender.tab.id);
|
||||
}
|
||||
verbose("got data", data, "from port", port);
|
||||
});
|
||||
});
|
||||
@ -80,13 +84,6 @@
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// hide page action when a tab is refreshed
|
||||
browser.tabs.onUpdated.addListener(function(tabId, data){
|
||||
if (data.status && data.status === "loading"){
|
||||
browser.pageAction.hide(tabId);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
browser.runtime.onInstalled.addListener(function(){
|
||||
|
@ -9,7 +9,7 @@ Version 0.4.3:
|
||||
-
|
||||
|
||||
fixes:
|
||||
-
|
||||
- page action was not always showing
|
||||
|
||||
Version 0.4.2
|
||||
new features:
|
||||
|
Loading…
x
Reference in New Issue
Block a user