aboutsummaryrefslogtreecommitdiffstats
path: root/platform
diff options
context:
space:
mode:
authorgorhill <rhill@raymondhill.net>2015-09-14 11:28:33 -0400
committergorhill <rhill@raymondhill.net>2015-09-14 11:28:33 -0400
commitbc287f98aa1337cfdafca136f9701fb00016ce1b (patch)
tree8e11ce6e6a62f129b4000c4d8a99d53d43a4eca3 /platform
parent6cc07a4027d37009b6ea72f524bdd9171dd010bb (diff)
downloaduBlock-bc287f98aa1337cfdafca136f9701fb00016ce1b.zip
uBlock-bc287f98aa1337cfdafca136f9701fb00016ce1b.tar.gz
uBlock-bc287f98aa1337cfdafca136f9701fb00016ce1b.tar.bz2
this fixes #697
Diffstat (limited to 'platform')
-rw-r--r--platform/firefox/frameModule.js2
-rw-r--r--platform/firefox/vapi-background.js18
2 files changed, 15 insertions, 5 deletions
diff --git a/platform/firefox/frameModule.js b/platform/firefox/frameModule.js
index 65de7a9..a11720e 100644
--- a/platform/firefox/frameModule.js
+++ b/platform/firefox/frameModule.js
@@ -432,7 +432,7 @@ LocationChangeListener.prototype.onLocationChange = function(webProgress, reques
}
this.messageManager.sendAsyncMessage(locationChangedMessageName, {
url: location.asciiSpec,
- flags: flags,
+ flags: flags
});
};
diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js
index f4d5239..c69b998 100644
--- a/platform/firefox/vapi-background.js
+++ b/platform/firefox/vapi-background.js
@@ -1035,7 +1035,11 @@ var tabWatcher = (function() {
vAPI.toolbarButton.attachToNewWindow(window);
}
- tabContainer.addEventListener('TabOpen', onOpen);
+ // 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?
@@ -1912,8 +1916,16 @@ vAPI.net.registerListeners = function() {
var locationChangedListenerMessageName = location.host + ':locationChanged';
var locationChangedListener = function(e) {
- var details = e.data;
var browser = e.target;
+
+ // https://github.com/gorhill/uBlock/issues/697
+ // Dismiss event if the associated tab is pending.
+ var tab = tabWatcher.tabFromBrowser(browser);
+ if ( !tab || tab.hasAttribute('pending') ) {
+ return;
+ }
+
+ var details = e.data;
var tabId = tabWatcher.tabIdFromTarget(browser);
// Ignore notifications related to our popup
@@ -1921,8 +1933,6 @@ vAPI.net.registerListeners = function() {
return;
}
- //console.debug("nsIWebProgressListener: onLocationChange: " + details.url + " (" + details.flags + ")");
-
// LOCATION_CHANGE_SAME_DOCUMENT = "did not load a new document"
if ( details.flags & Ci.nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT ) {
vAPI.tabs.onUpdated(tabId, {url: details.url}, {