Skip to content

Commit

Permalink
testing:
Browse files Browse the repository at this point in the history
  • Loading branch information
daslyfe committed Aug 12, 2024
1 parent bfead58 commit 2899ee5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions website/src/repl/util.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 2899ee5

Please sign in to comment.