Skip to content

Commit 975c455

Browse files
authored
🐛 [RUM-11614][URL polyfill] Handle null iframe.contentWindow (#4361)
1 parent c46e900 commit 975c455

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/core/src/tools/utils/urlPolyfill.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export function getPristineWindow() {
4242
iframe = document.createElement('iframe')
4343
iframe.style.display = 'none'
4444
document.body.appendChild(iframe)
45-
pristineWindow = iframe.contentWindow as Window & typeof globalThis
45+
pristineWindow = (iframe.contentWindow ?? globalObject) as Window & typeof globalThis
4646
} catch {
4747
pristineWindow = globalObject as unknown as Window & typeof globalThis
4848
}

0 commit comments

Comments
 (0)