浏览代码

define globalThis object if undefined (see #643)

Gildas 4 年之前
父节点
当前提交
cbe1300644
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      lib/single-file/processors/hooks/content/content-hooks-frames.js

+ 3 - 0
lib/single-file/processors/hooks/content/content-hooks-frames.js

@@ -122,6 +122,9 @@ function loadDeferredImagesResetZoomLevel(options) {
 }
 
 function injectedScript() {
+	if (typeof globalThis == "undefined") {
+		window.globalThis = window;
+	}
 	const console = globalThis.console;
 	const dispatchEvent = event => globalThis.dispatchEvent(event);
 	const CustomEvent = globalThis.CustomEvent;