Prevent double script on trusted file:// pages in some edge cases.

This commit is contained in:
hackademix 2021-02-06 23:08:22 +01:00
parent cf7d8408f0
commit e158441412
1 changed files with 4 additions and 1 deletions

View File

@ -50,7 +50,10 @@
};
debug("Initial readyState and body", document.readyState, document.body);
let mustFreeze = UA.isMozilla && (!/^(?:image|video|audio)/.test(document.contentType) || document instanceof XMLDocument);
let mustFreeze = UA.isMozilla
&& (!/^(?:image|video|audio)/.test(document.contentType) || document instanceof XMLDocument)
&& document.readyState !== "complete";
if (mustFreeze) {
// Mozilla has already parsed the <head> element, we must take extra steps...