diff options
Diffstat (limited to 'src/bg/RequestGuard.js')
-rw-r--r-- | src/bg/RequestGuard.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/bg/RequestGuard.js b/src/bg/RequestGuard.js index 436d043..9be532f 100644 --- a/src/bg/RequestGuard.js +++ b/src/bg/RequestGuard.js @@ -292,6 +292,7 @@ var RequestGuard = (() => { async onHeadersReceived(request) { // called for main_frame, sub_frame and object // check for duplicate calls + let headersModified = false; let pending = pendingRequests.get(request.requestId); if (pending) { if (pending.headersProcessed) { @@ -319,7 +320,10 @@ var RequestGuard = (() => { capabilities = perms.capabilities; } else { if (isMainFrame || type === "sub_frame") { - await Settings.enforceTabRestrictions(tabId); + let unrestricted = ns.unrestrictedTabs.has(tabId) && {unrestricted: true}; + if (unrestricted) { + headersModified = ChildPolicies.addTabInfoCookie(request, unrestricted); + } } } if (isMainFrame && !TabStatus.map.has(tabId)) { @@ -331,6 +335,9 @@ var RequestGuard = (() => { if (header) { pending.cspHeader = header; debug(`CSP blocker on %s:`, url, header.value); + headersModified = true; + } + if (headersModified) { return {responseHeaders}; } } catch (e) { |