Browse Source

hack to avoid injecting SingleFile scripts too early

Former-commit-id: 82a5b728e73b656e68ccb587f3ee95fc4c550d75
Gildas 6 năm trước cách đây
mục cha
commit
7cc2bfe811
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      cli/back-ends/webdriver-gecko.js

+ 3 - 0
cli/back-ends/webdriver-gecko.js

@@ -82,6 +82,9 @@ exports.getPageData = async options => {
 			await driver.sleep(3000);
 		}
 		await driver.get(options.url);
+		while (await driver.getCurrentUrl() == "about:blank") {
+			// do nothing
+		}
 		scripts = scripts.replace(/\n(this)\.([^ ]+) = (this)\.([^ ]+) \|\|/g, "\nwindow.$2 = window.$4 ||");
 		await driver.executeScript(scripts);
 		if (options.browserWaitUntil != "domcontentloaded") {