We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3942740 commit 54bfd1cCopy full SHA for 54bfd1c
.changeset/cyan-emus-prove.md
@@ -0,0 +1,5 @@
1
+---
2
+'@module-federation/runtime': patch
3
4
+
5
+fix(runtime): use document.defaultView to get real window object to solve csp issue
packages/runtime/src/global.ts
@@ -28,8 +28,10 @@ export interface Federation {
28
29
export const nativeGlobal: typeof global = (() => {
30
try {
31
- return new Function('return this')();
+ // get real window (incase of sandbox)
32
+ return document.defaultView;
33
} catch {
34
+ // node env
35
return globalThis;
36
}
37
})() as typeof global;
0 commit comments