mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-07 03:12:33 +01:00
Fix thrown exception in onHeadersReceived listener
Regression from: - https://github.com/gorhill/uBlock/commit/ae56c4dfe855
This commit is contained in:
parent
8935956260
commit
ecd81183b1
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user