Преглед изворни кода

hack to avoid injecting SingleFile scripts too early

Former-commit-id: 82a5b728e73b656e68ccb587f3ee95fc4c550d75
Gildas пре 6 година
родитељ
комит
7cc2bfe811
1 измењених фајлова са 3 додато и 0 уклоњено
  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") {