Ver código fonte

wait for onload when auto-saving pages

Former-commit-id: c633ebc76609fef7df3cdf33d35b7f4efbf0061b
Gildas 6 anos atrás
pai
commit
de7c872893
1 arquivos alterados com 3 adições e 0 exclusões
  1. 3 0
      extension/core/content/content-bootstrap.js

+ 3 - 0
extension/core/content/content-bootstrap.js

@@ -57,6 +57,9 @@ this.singlefile.extension.core.content.bootstrap = this.singlefile.extension.cor
 	async function onMessage(message) {
 		if (autoSaveEnabled && message.method == "content.autosave") {
 			options = message.options;
+			if (document.readyState != "complete") {
+				await new Promise(resolve => window.onload = resolve);
+			}
 			await autoSavePage();
 			if (options.autoSaveRepeat) {
 				setTimeout(() => {