[Firefox] Fix regression causing file:// policy not to be correctly enforced sometimes.
This commit is contained in:
parent
11d7cfc4c8
commit
9b0553f760
|
@ -668,9 +668,6 @@ var RequestGuard = (() => {
|
|||
ns.domPolicy = domPolicy;
|
||||
if (ns.setup) {
|
||||
if (ns.syncSetup) ns.syncSetup(domPolicy);
|
||||
else if (!ns.pendingSyncFetchPolicy) {
|
||||
ns.setup(domPolicy);
|
||||
}
|
||||
} ;
|
||||
} else {
|
||||
window.ns = {domPolicy}
|
||||
|
|
|
@ -72,6 +72,13 @@
|
|||
}
|
||||
}
|
||||
|
||||
if (this.syncFetchPolicy) {
|
||||
// extra hops to ensure that scripts don't run when CSP has not been set through HTTP headers
|
||||
this.syncFetchPolicy();
|
||||
} else {
|
||||
this.pendingSyncFetchPolicy = true;
|
||||
}
|
||||
|
||||
if (!sync) {
|
||||
queueMicrotask(() => this.fetchPolicy(true));
|
||||
return;
|
||||
|
@ -86,10 +93,8 @@
|
|||
debug("Fetching policy for actual URL %s (was %s)", url, document.URL);
|
||||
}
|
||||
|
||||
if (this.syncFetchPolicy) {
|
||||
// extra hops to ensure that scripts don't run when CSP has not been set through HTTP headers
|
||||
this.syncFetchPolicy();
|
||||
} else {
|
||||
if (!this.syncFetchPolicy) {
|
||||
|
||||
let msg = {id: "fetchChildPolicy", url, contextUrl: url};
|
||||
|
||||
let asyncFetch = (async () => {
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
}
|
||||
let syncFetch = callback => {
|
||||
browser.runtime.sendSyncMessage(
|
||||
{id: "fetchPolicy", url, contextUrl: url},
|
||||
{id: "fetchChildPolicy", url, contextUrl: url},
|
||||
callback);
|
||||
};
|
||||
debug("Initial readyState and body", document.readyState, document.body);
|
||||
|
|
Loading…
Reference in New Issue