Sfoglia il codice sorgente

use window instead of this

Gildas 5 anni fa
parent
commit
5e439e8928
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      extension/core/content/content-bootstrap.js

+ 2 - 2
extension/core/content/content-bootstrap.js

@@ -126,7 +126,7 @@ this.extension.core.content.bootstrap = this.extension.core.content.bootstrap ||
 				await new Promise(resolve => autoSaveTimeout = setTimeout(resolve, options.autoSaveDelay * 1000));
 				await autoSavePage();
 			} else {
-				const waitForUserScript = this._singleFile_waitForUserScript;
+				const waitForUserScript = window._singleFile_waitForUserScript;
 				let frames = [];
 				let framesSessionId;
 				autoSaveTimeout = null;
@@ -167,7 +167,7 @@ this.extension.core.content.bootstrap = this.extension.core.content.bootstrap ||
 	function onUnload() {
 		const helper = singlefile.helper;
 		if (!pageAutoSaved || options.autoSaveUnload) {
-			const waitForUserScript = this._singleFile_waitForUserScript;
+			const waitForUserScript = window._singleFile_waitForUserScript;
 			let frames = [];
 			if (!options.removeFrames && window.frames && window.frames.length) {
 				frames = singlefile.processors.frameTree.getSync(options);