Skip to content

Commit 2b1cfdd

Browse files
authored
Merge pull request #18 from supabase/expose-window-global
fix: expose window/self as global properties
2 parents e9142df + 3e0f495 commit 2b1cfdd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

base/src/js_worker/js/bootstrap.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,9 +575,12 @@
575575

576576
ObjectDefineProperties(window, globalScope);
577577

578-
ObjectDefineProperties(globalThis, {
578+
const globalProperties = {
579579
Window: globalInterfaces.windowConstructorDescriptor,
580-
});
580+
window: getterOnly(() => globalThis),
581+
self: getterOnly(() => globalThis),
582+
};
583+
ObjectDefineProperties(globalThis, globalProperties);
581584
ObjectSetPrototypeOf(globalThis, Window.prototype);
582585

583586
// TODO: figure out if this is needed

0 commit comments

Comments
 (0)