"Soft reload" approach to fix file: and ftp: issues.

This commit is contained in:
hackademix 2020-08-30 01:21:11 +02:00
parent f9d4e08047
commit 703d85f015
3 changed files with 37 additions and 56 deletions

File diff suppressed because one or more lines are too long

View File

@ -216,11 +216,6 @@
if (MOZILLA) {
// In order to cope with inconsistencies in XHR synchronicity,
// allowing scripts to be executed (especially with synchronous loads
// or when other extensions manipulate the DOM early) we additionally
// suspend on beforescriptexecute events
let startTime = Date.now(); // DEV_ONLY
let suspendURL = url + "&suspend=true";
let suspended = 0;
@ -240,22 +235,8 @@
console.debug("sendSyncMessage resume #%s/%s - %sms", id, suspended, Date.now() - startTime); // DEV_ONLY
};
let domSuspender = new MutationObserver(records => {
console.debug("sendSyncMessage suspending on ", records)
suspend();
});
domSuspender.observe(document, {childList: true, subtree: true});
let bodySuspender = e => {
console.debug("Suspending on DOMContentLoaded");
suspend();
};
addEventListener("DOMContentLoaded", bodySuspender, true);
let finalize = () => {
console.debug("sendSyncMessage finalizing");
domSuspender.disconnect();
removeEventListener("DOMContentLoaded", bodySuspender, true);
};
// on Firefox we first need to send an async message telling the

View File

@ -77,7 +77,6 @@
"run_at": "document_start",
"matches": ["file://*/*", "ftp://*/*"],
"js": [
"lib/SyncMessage.js",
"content/syncFetchPolicy.js"
]
},
@ -89,6 +88,7 @@
"js": [
"lib/UA.js",
"lib/browser-polyfill.js",
"lib/SyncMessage.js",
"lib/log.js",
"lib/uuid.js",
"lib/sha256.js",
@ -106,6 +106,7 @@
"content/sanitizePaste.js"
]
},
{
"run_at": "document_start",
"matches": ["ftp://*/*"],