snapshot of https://github.com/jitsi/jitsi-meet.git @ fd1749dd28f4138aa80234fc7f311b19aaffa0e7 (2026-09-15)
This commit is contained in:
26
react/features/base/util/embedUtils.web.ts
Normal file
26
react/features/base/util/embedUtils.web.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Checks whether we are loaded in iframe.
|
||||
*
|
||||
* @returns {boolean} Whether the current page is loaded in an iframe.
|
||||
*/
|
||||
export function isEmbedded(): boolean {
|
||||
try {
|
||||
return window.self !== window.top;
|
||||
} catch (e) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks whether we are loaded in iframe with same parent domain.
|
||||
*
|
||||
* @returns {boolean} Whether the current page is loaded in an iframe with same parent domain.
|
||||
*/
|
||||
export function isEmbeddedFromSameDomain(): boolean {
|
||||
try {
|
||||
return window.self.location.host === window.parent.location.host;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user