Fetch policies asynchronously for about: and javascript: URLs.
This commit is contained in:
parent
049485e495
commit
4f08302084
|
@ -40,13 +40,14 @@
|
|||
, document.documentElement.outerHTML, // DEV_ONLY
|
||||
document.domain, document.baseURI, window.isSecureContext // DEV_ONLY
|
||||
);
|
||||
|
||||
if (!/^(?:file|ftp|https?):/i.test(url)) {
|
||||
if (/^(javascript|about):/.test(url)) {
|
||||
url = document.readyState === "loading"
|
||||
? document.baseURI
|
||||
: `${window.isSecureContext ? "https" : "http"}://${document.domain}`;
|
||||
debug("Fetching policy for actual URL %s (was %s)", url, document.URL);
|
||||
}
|
||||
if (!/^(?:file|ftp|https?):/i.test(url)) {
|
||||
(async () => {
|
||||
let policy;
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue