소스 검색

fix globalThis issue

Gildas 4 년 전
부모
커밋
43dbbb5e2a
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      cli/back-ends/webdriver-gecko.js

+ 1 - 1
cli/back-ends/webdriver-gecko.js

@@ -109,7 +109,7 @@ async function getPageData(driver, options) {
 			// do nothing
 		}
 	}
-	scripts = scripts.replace(/\n(this)\.([^ ]+) = (this)\.([^ ]+) \|\|/g, "\nwindow.$2 = window.$4 ||");
+	scripts = scripts.replace(/globalThis/g, "window");
 	await driver.executeScript(scripts);
 	if (options.browserWaitUntil != "domcontentloaded") {
 		let scriptPromise;