From 2899ee5aef812c545a83d4ebfb910492f6fac37c Mon Sep 17 00:00:00 2001 From: "Jade (Rose) Rowland" Date: Mon, 12 Aug 2024 18:11:52 -0400 Subject: [PATCH] testing: --- website/src/repl/util.mjs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/website/src/repl/util.mjs b/website/src/repl/util.mjs index 8d8cfba49..cbd5eba3f 100644 --- a/website/src/repl/util.mjs +++ b/website/src/repl/util.mjs @@ -134,9 +134,17 @@ export async function shareCode(codeToShare) { export const ReplContext = createContext(null); +function isCrossOriginFrame() { + try { + return (!window.top.location.hostname); + } catch (e) { + return true; + } +} + + export const isUdels = () => { - const isIframe = window.location !== window.parent.location; - if (isIframe) { + if (isCrossOriginFrame()) { return false; } return window.parent?.location?.pathname.includes('udels');