Kaynağa Gözat

replace window with globalThis

Gildas 4 yıl önce
ebeveyn
işleme
d0c784da71
1 değiştirilmiş dosya ile 4 ekleme ve 2 silme
  1. 4 2
      extension/index.js

+ 4 - 2
extension/index.js

@@ -21,11 +21,13 @@
  *   Source.
  */
 
-/* global window */
+/* global globalThis */
 
 import * as scripts from "./lib/single-file/core/bg/scripts.js";
 import { fetch, frameFetch } from "./lib/single-file/fetch/content/content-fetch.js";
 
+const singlefile = globalThis.singlefile;
+
 export {
 	injectScript,
 	getPageData
@@ -36,5 +38,5 @@ function injectScript(tabId, options) {
 }
 
 function getPageData(options, doc, win, initOptions = { fetch, frameFetch }) {
-	return window.singlefile.getPageData(options, initOptions, doc, win);
+	return singlefile.getPageData(options, initOptions, doc, win);
 }