This commit is contained in:
Jade (Rose) Rowland 2024-08-12 18:11:52 -04:00
parent bfead58212
commit 2899ee5aef

View File

@ -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');