File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020
2121// depends on /nscl/service/NavCache.js
2222
23+ // This module is meant to replace the granular content blocking performed by RequestGuard.js
24+ // on Manifest V2/2.5 (based on Firefox's blocking async webRequest API)
25+ // with a declarativeNetRequest implementation on Manifest V3.
26+ // One IMPORTANT difference is that this implementation won't try to inject Content-Security-Policy
27+ // headers in documents for content blocking (the only one being injected is for reporting only):
28+ // in MV3 all the CSP heavy lifting is done by staticNS.js via nscl's DocumentCSP, so it's vital
29+ // that content-side the correct policy is always fetched timely (synchronously, if needed).
30+
2331'use strict' ;
2432{
2533 const DEFAULT_PRIORITY = 1 ;
Original file line number Diff line number Diff line change 121121 } ) ;
122122 const { readyState} = document ;
123123 asyncFetch ( ) ;
124+ // WARNING: be careful adding exceptions to sync fetching here, since on MV3 we never have
125+ // content-blocking CSP headers injected at the network level (DNRPolicy.js doesn't).
124126 if ( this . policy || readyState == "complete" ||
125- ! this . syncFetchPolicy && this . embeddingDocument ||
126127 window . origin == "null" && window . location . href == "about:blank" && window . top == self
127128 ) {
128129 // no point trying sync too in these cases
You can’t perform that action at this time.
0 commit comments