Skip to content

Commit

Permalink
chore: update selfWindow to rootWindow (#397)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalton authored Oct 24, 2022
1 parent 47484ee commit f989485
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions packages/near-membrane-dom/src/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
ReflectOwnKeys,
toSafeWeakMap,
} from '@locker/near-membrane-shared';
import { selfWindow } from '@locker/near-membrane-shared-dom';
import { rootWindow } from '@locker/near-membrane-shared-dom';

interface CachedBlueReferencesRecord extends Object {
document: Document;
Expand All @@ -31,7 +31,7 @@ export const unforgeablePoisonedWindowKeys = (() => {
// to avoid triggering its getter.
navigator,
navigator: { userAgentData },
}: any = selfWindow;
}: any = rootWindow;
// The user-agent client hints API is experimental and subject to change.
// https://caniuse.com/mdn-api_navigator_useragentdata
const brands: { brand: string; version: string }[] = userAgentData?.brands;
Expand Down Expand Up @@ -152,4 +152,4 @@ export function removeWindowDescriptors<T extends PropertyDescriptorMap>(unsafeD
* usually help because this library runs before anything else that can poison
* the environment.
*/
getCachedGlobalObjectReferences(selfWindow);
getCachedGlobalObjectReferences(rootWindow);
2 changes: 1 addition & 1 deletion packages/near-membrane-shared-dom/src/Window.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const selfWindow = window;
export const rootWindow = window;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { selfWindow } from '../../dist/index';
import { rootWindow } from '../../dist/index';

describe('Window', () => {
it('selfWindow', () => {
expect(selfWindow).toBe(window);
it('rootWindow', () => {
expect(rootWindow).toBe(window);
});
});

0 comments on commit f989485

Please sign in to comment.