Skip to content

Commit db18c27

Browse files
committed
Do not retry failed synchronous policy retrievals if document is not loading.
1 parent 7993f46 commit db18c27

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/content/staticNS.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ const FILE_OR_FTP = /^(?:file|ftp):$/.test(location.protocol);
119119
}
120120
debug(`Synchronously fetching policy for ${url}.`);
121121
let policy = null;
122-
let attempts = 100;
122+
let attempts = document.readyState == "loading" ? 100 : 1;
123123
let refetch = () => {
124124
try {
125125
policy = browser.runtime.sendSyncMessage(msg) || this.domPolicy;

0 commit comments

Comments
 (0)