From 9a6b1c2c9c37099afa3f67f70e6b861c11b5159e Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Tue, 16 Oct 2018 10:58:04 -0300 Subject: [PATCH] address remaining quirks (see https://github.com/uBlockOrigin/uMatrix-issues/issues/62#issuecomment-428594617) --- src/js/logger-ui.js | 4 ++-- src/js/messaging.js | 7 +------ src/js/pagestats.js | 2 ++ 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/js/logger-ui.js b/src/js/logger-ui.js index e0d13ff..e95493c 100644 --- a/src/js/logger-ui.js +++ b/src/js/logger-ui.js @@ -556,7 +556,7 @@ var pageSelectorChanged = function() { ); } document.getElementById('reloadTab').classList.toggle('disabled', tabId <= 0); - document.getElementById('popupPanelButton').classList.toggle('disabled', tabId === 0); + document.getElementById('popupPanelButton').classList.toggle('disabled', tabId <= 0); popupPanel.update(); }; @@ -672,7 +672,7 @@ var popupPanel = (function() { let start = function() { let newTabId = tabIdFromPageSelector(); - if ( newTabId === 0 ) { + if ( newTabId <= 0 ) { return stop(); } if ( newTabId === tabId ) { return; } diff --git a/src/js/messaging.js b/src/js/messaging.js index ce8136d..8495702 100644 --- a/src/js/messaging.js +++ b/src/js/messaging.js @@ -369,12 +369,7 @@ var matrixSnapshotFromTabId = function(details, callback) { callback('ENOTFOUND'); return; } - - // Allow examination of behind-the-scene requests - var tabId = tab.url.lastIndexOf(vAPI.getURL('dashboard.html'), 0) !== 0 ? - tab.id : - vAPI.noTabId; - matrixSnapshotIf(tabId, details); + matrixSnapshotIf(tab.id, details); }; vAPI.tabs.get(null, onTabReady); diff --git a/src/js/pagestats.js b/src/js/pagestats.js index 8b52b15..2954da8 100644 --- a/src/js/pagestats.js +++ b/src/js/pagestats.js @@ -208,6 +208,8 @@ PageStore.prototype = { }, recordRequest: function(type, url, block) { + if ( this.tabId <= 0 ) { return; } + if ( block ) { this.perLoadBlockedRequestCount++; } else {