Skip to content

Commit

Permalink
fix(adblocker): match logic between onHeadersReceived and onBeforeReq…
Browse files Browse the repository at this point in the history
…uest (#2021)
  • Loading branch information
smalluban authored Nov 4, 2024
1 parent e2d5cb4 commit 0a8a9a4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/background/adblocker.js
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ if (__PLATFORM__ === 'firefox') {
if (details.tabId < 0 || details.type === 'main_frame') return;

if (setup.pending) {
console.error('[adblocker] not ready for network blocking');
console.error('[adblocker] not ready for network requests blocking');
return;
}

Expand Down Expand Up @@ -500,8 +500,10 @@ if (__PLATFORM__ === 'firefox') {

chrome.webRequest.onHeadersReceived.addListener(
(details) => {
if (details.tabId < 0 || details.type === 'main_frame') return;

if (setup.pending) {
console.error('[adblocker] not ready for network modification');
console.error('[adblocker] not ready for network headers modification');
return;
}

Expand Down

0 comments on commit 0a8a9a4

Please sign in to comment.