From 6c807909752401be44f126de0e5fafd9b6f6d179 Mon Sep 17 00:00:00 2001 From: gorhill Date: Wed, 29 Apr 2015 10:29:23 -0400 Subject: [PATCH] one more step to insure tab context is properly set --- platform/firefox/vapi-background.js | 2 +- src/js/tab.js | 4 ++++ src/js/traffic.js | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js index 24b38ef7e..8446a1a0d 100644 --- a/platform/firefox/vapi-background.js +++ b/platform/firefox/vapi-background.js @@ -1938,7 +1938,7 @@ vAPI.onLoadAllCompleted = function() { var tabId = this.tabs.getTabId(tab); var browser = getBrowserForTab(tab); µb.tabContextManager.commit(tabId, browser.currentURI.asciiSpec); - µb.bindTabToPageStats(tabId, browser.currentURI.asciiSpec); + µb.bindTabToPageStats(tabId); browser.messageManager.sendAsyncMessage( location.host + '-load-completed' ); diff --git a/src/js/tab.js b/src/js/tab.js index af4a9f258..d4cadf1e1 100644 --- a/src/js/tab.js +++ b/src/js/tab.js @@ -209,6 +209,10 @@ housekeep itself. if ( vAPI.isBehindTheSceneTabId(this.tabId) ) { return; } + var count = this.stack.length; + if ( count !== 0 && this.stack[count - 1] === url ) { + return; + } this.stack.push(url); this.update(); }; diff --git a/src/js/traffic.js b/src/js/traffic.js index 666122529..5dabaa0e1 100644 --- a/src/js/traffic.js +++ b/src/js/traffic.js @@ -359,6 +359,8 @@ var onRootFrameHeadersReceived = function(details) { // https://github.com/chrisaljoudi/uBlock/issues/516 if ( headerValue(details.responseHeaders, 'content-type').lastIndexOf('application/x-', 0) === 0 ) { µb.tabContextManager.unpush(tabId, details.url); + } else { + µb.tabContextManager.push(tabId, details.url); } // Lookup the page store associated with this tab id.