File size: 736 Bytes
01fcadf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
---
import LoadingComponent from "@components/Loading.astro";
import Layout from "@layouts/Layout.astro";
---

<Layout title="Loading page..." noHeader="true">
    <LoadingComponent />
</Layout>
<script>
    import { pageLoad } from "@utils/events";
    import { navigate } from "astro:transitions/client";
    function isComingFromIframe() {
        try {
            return window.self !== window.top;
        }
        catch (e) {
            return true;
        }
    }
    pageLoad(() => {
        const isIframe = isComingFromIframe();
        if (!isIframe) {
            console.log("Assuming request isn't coming from iFrame. Redirecting...");
            navigate('/');
        }
    });
</script>