mirror of
https://codeberg.org/uzu/strudel
synced 2026-07-27 15:29:18 -04:00
testing:
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user