1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-01-18 09:28:52 +01: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; var tab, tabBrowser;
if (browser){ if (browser){
window = tabUtils.getOwnerWindow(browser); window = tabUtils.getOwnerWindow(browser);
if (!window){
return;
}
tab = tabUtils.getTabForBrowser(browser); tab = tabUtils.getTabForBrowser(browser);
if (!tab){
// page ist displayed in preview
return;
}
tabBrowser = tabUtils.getTabBrowser(window); tabBrowser = tabUtils.getTabBrowser(window);
} }
else if (window){ else if (window){
tab = tabUtils.getTabForContentWindow(window); tab = tabUtils.getTabForContentWindow(window);
tabBrowser = tabUtils.getTabBrowserForTab(tab); tabBrowser = tabUtils.getTabBrowserForTab(tab);
browser = tabUtils.getBrowserForTab(tab); browser = tabUtils.getBrowserForTab(tab);