1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2024-05-29 09:28:06 +02:00

Prevented error message when notifications where triggered on preview, which is not possible.

This commit is contained in:
kkapsner 2017-01-31 20:03:48 +01:00
parent ec1ae73cda
commit 9c7e842f4b

View File

@ -23,10 +23,17 @@ exports.notify = function({url, errorStack, messageId}, {lists, notificationPref
var tab, tabBrowser;
if (browser){
window = tabUtils.getOwnerWindow(browser);
if (!window){
return;
}
tab = tabUtils.getTabForBrowser(browser);
if (!tab){
// page ist displayed in preview
return;
}
tabBrowser = tabUtils.getTabBrowser(window);
}
else if (window){
else if (window){
tab = tabUtils.getTabForContentWindow(window);
tabBrowser = tabUtils.getTabBrowserForTab(tab);
browser = tabUtils.getBrowserForTab(tab);