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 8b4b25d commit 2634e65Copy full SHA for 2634e65
packages/codesandbox-api/src/dispatcher/index.ts
@@ -3,9 +3,20 @@
3
4
const bundlers: Map<Window, string> = new Map();
5
6
+function checkIsStandalone() {
7
+ if (typeof window === 'undefined') {
8
+ return true;
9
+ }
10
+
11
+ if (window.location && window.location.href.indexOf('?standalone') > -1) {
12
13
14
15
+ return !window.opener && window.parent === window;
16
+}
17
18
// Whether the tab has a connection with the editor
-export const isStandalone =
- typeof window === 'undefined' || (!window.opener && window.parent === window);
19
+export const isStandalone = checkIsStandalone();
20
21
let parentOrigin: string | null = null;
22
0 commit comments