Files
jitsi-meet/react/features/base/util/iframeUtils.ts
Saúl Ibarra Corretgé b0deb9ec0c fix(lint) make sure eslint also runs on TypeScript files (#11777)
Co-authored-by: robertpin <robert.pin9@gmail.com>
Co-authored-by: Gabriel Borlea <gabriel.borlea@8x8.com>
2022-07-11 15:30:37 +03:00

17 lines
339 B
TypeScript

/**
* Checks whether we are loaded in iframe.
*
* @returns {boolean} Whether the current page is loaded in an iframe.
*/
export function inIframe(): boolean {
if (navigator.product === 'ReactNative') {
return false;
}
try {
return window.self !== window.top;
} catch (e) {
return true;
}
}