Skip to content

Commit 57d6fc8

Browse files
committed
Only consider embedded if one of preview or hint is enabled
1 parent 2986c5d commit 57d6fc8

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

assets/js/globals.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
const params = new URLSearchParams(window.location.search)
2+
const isFrame = window.self !== window.parent
23

3-
export const isEmbedded = window.self !== window.parent
4-
5-
export const isPreview = params.has('preview')
6-
7-
export const isHint = params.has('hint')
4+
export const isPreview = isFrame && params.has('preview')
5+
export const isHint = isFrame && params.has('hint')
6+
export const isEmbedded = isPreview || isHint
87

98
// These variables are set by other scripts (e.g. generated by the docs task).
109

0 commit comments

Comments
 (0)