diff --git a/src/js/tab.js b/src/js/tab.js index 50504f47a..cb0f6febd 100644 --- a/src/js/tab.js +++ b/src/js/tab.js @@ -912,7 +912,7 @@ vAPI.tabs.registerListeners(); { const NoPageStore = class extends µBlock.PageStore { getNetFilteringSwitch(fctxt) { - if ( fctxt.docId === 0 ) { + if ( fctxt && fctxt.docId === 0 ) { const docOrigin = fctxt.getDocOrigin(); if ( docOrigin ) { return µBlock.getNetFilteringSwitch(docOrigin); diff --git a/src/js/traffic.js b/src/js/traffic.js index 96b5ad6f4..9b587e3ca 100644 --- a/src/js/traffic.js +++ b/src/js/traffic.js @@ -440,7 +440,7 @@ const onHeadersReceived = function(details) { if ( isRootDoc === false ) { return; } pageStore = µb.bindTabToPageStats(fctxt.tabId, 'beforeRequest'); } - if ( pageStore.getNetFilteringSwitch() === false ) { return; } + if ( pageStore.getNetFilteringSwitch(fctxt) === false ) { return; } // Keep in mind response headers will be modified in-place if needed, so // `details.responseHeaders` will always point to the modified response