"Fossies" - the Fresh Open Source Software Archive

Member "jitsi-meet-7316/react/features/base/util/iframeUtils.ts" (5 Jun 2023, 339 Bytes) of package /linux/misc/jitsi-meet-7316.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) TypeScript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /**
    2  * Checks whether we are loaded in iframe.
    3  *
    4  * @returns {boolean} Whether the current page is loaded in an iframe.
    5  */
    6 export function inIframe(): boolean {
    7     if (navigator.product === 'ReactNative') {
    8         return false;
    9     }
   10 
   11     try {
   12         return window.self !== window.top;
   13     } catch (e) {
   14         return true;
   15     }
   16 }