Explorar o código

replace window with globalThis

Gildas %!s(int64=4) %!d(string=hai) anos
pai
achega
d0c784da71
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  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);
 }