testing:
This commit is contained in:
parent
bfead58212
commit
2899ee5aef
1 changed files with 10 additions and 2 deletions
|
|
@ -134,9 +134,17 @@ export async function shareCode(codeToShare) {
|
||||||
|
|
||||||
export const ReplContext = createContext(null);
|
export const ReplContext = createContext(null);
|
||||||
|
|
||||||
|
function isCrossOriginFrame() {
|
||||||
|
try {
|
||||||
|
return (!window.top.location.hostname);
|
||||||
|
} catch (e) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
export const isUdels = () => {
|
export const isUdels = () => {
|
||||||
const isIframe = window.location !== window.parent.location;
|
if (isCrossOriginFrame()) {
|
||||||
if (isIframe) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return window.parent?.location?.pathname.includes('udels');
|
return window.parent?.location?.pathname.includes('udels');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue