aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgorhill <rhill@raymondhill.net>2015-10-16 10:13:33 -0400
committergorhill <rhill@raymondhill.net>2015-10-16 10:13:33 -0400
commit7d9525d6e91f3cb0ae3f868855d342769df17be2 (patch)
tree5dc92b8a9f7a4acb186aa25eaca5ceb818efb9d2
parentadc84350e3a96f7653d2e73f817478749ec393dc (diff)
downloaduBlock-7d9525d6e91f3cb0ae3f868855d342769df17be2.zip
uBlock-7d9525d6e91f3cb0ae3f868855d342769df17be2.tar.gz
uBlock-7d9525d6e91f3cb0ae3f868855d342769df17be2.tar.bz2
let's see if this helps #833
-rw-r--r--platform/firefox/vapi-background.js25
1 files changed, 13 insertions, 12 deletions
diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js
index 78840b2..0a4b98d 100644
--- a/platform/firefox/vapi-background.js
+++ b/platform/firefox/vapi-background.js
@@ -1090,29 +1090,29 @@ var tabWatcher = (function() {
return false;
}
+ if ( typeof vAPI.toolbarButton.attachToNewWindow === 'function' ) {
+ vAPI.toolbarButton.attachToNewWindow(window);
+ }
+
var tabContainer;
if ( tabBrowser.deck ) { // Fennec
tabContainer = tabBrowser.deck;
} else if ( tabBrowser.tabContainer ) { // Firefox
tabContainer = tabBrowser.tabContainer;
vAPI.contextMenu.register(window.document);
- } else {
- return true;
- }
-
- if ( typeof vAPI.toolbarButton.attachToNewWindow === 'function' ) {
- vAPI.toolbarButton.attachToNewWindow(window);
}
// https://github.com/gorhill/uBlock/issues/697
// Ignore `TabShow` events: unfortunately the `pending` attribute is
// not set when a tab is opened as a result of session restore -- it is
// set *after* the event is fired in such case.
- //tabContainer.addEventListener('TabOpen', onOpen);
- tabContainer.addEventListener('TabShow', onShow);
- tabContainer.addEventListener('TabClose', onClose);
- // when new window is opened TabSelect doesn't run on the selected tab?
- tabContainer.addEventListener('TabSelect', onSelect);
+ if ( tabContainer ) {
+ //tabContainer.addEventListener('TabOpen', onOpen);
+ tabContainer.addEventListener('TabShow', onShow);
+ tabContainer.addEventListener('TabClose', onClose);
+ // when new window is opened TabSelect doesn't run on the selected tab?
+ tabContainer.addEventListener('TabSelect', onSelect);
+ }
return true;
};
@@ -2354,7 +2354,8 @@ vAPI.toolbarButton = {
var addLegacyToolbarButton = function(window) {
var document = window.document;
- var toolbox = document.getElementById('navigator-toolbox') || document.getElementById('mail-toolbox');
+ var toolbox = document.getElementById('navigator-toolbox') ||
+ document.getElementById('mail-toolbox');
if ( !toolbox ) {
return;
}