diff --git a/src/ffi.ts b/src/ffi.ts index 7b58a61..e0be4f8 100644 --- a/src/ffi.ts +++ b/src/ffi.ts @@ -88,7 +88,7 @@ export function unload() { // Automatically run the preload if we're on windows and on the main thread. if (Deno.build.os === "windows") { - if ((self as never)["window"]) { + if (self === globalThis) { await preload(); } else if (!await checkForWebView2Loader()) { throw new Error(