From 926c893c4fca04b9dd5c40128240e1746e20ab31 Mon Sep 17 00:00:00 2001 From: "Jade (Rose) Rowland" Date: Mon, 12 Aug 2024 12:54:05 -0400 Subject: [PATCH 1/2] check iframe --- website/src/repl/util.mjs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/website/src/repl/util.mjs b/website/src/repl/util.mjs index c43c29e6..04f137c1 100644 --- a/website/src/repl/util.mjs +++ b/website/src/repl/util.mjs @@ -135,7 +135,11 @@ export async function shareCode(codeToShare) { export const ReplContext = createContext(null); export const isUdels = () => { - return window.parent?.location.pathname.includes('udels'); + const isIframe = window.location !== window.parent.location; + if (isIframe) { + return false + } + return window.parent?.location?.pathname.includes('udels'); }; export const getAudioDevices = async () => { From bfead58212cb0eb285a8a842ed12987d236b7b5c Mon Sep 17 00:00:00 2001 From: "Jade (Rose) Rowland" Date: Mon, 12 Aug 2024 12:56:04 -0400 Subject: [PATCH 2/2] prettier --- website/src/repl/util.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/src/repl/util.mjs b/website/src/repl/util.mjs index 04f137c1..8d8cfba4 100644 --- a/website/src/repl/util.mjs +++ b/website/src/repl/util.mjs @@ -137,7 +137,7 @@ export const ReplContext = createContext(null); export const isUdels = () => { const isIframe = window.location !== window.parent.location; if (isIframe) { - return false + return false; } return window.parent?.location?.pathname.includes('udels'); };