fix(iframe) don't register service worker when in an iframe
Fixes: https://github.com/jitsi/jitsi-meet/issues/9712
This commit is contained in:
parent
605ce9db62
commit
5bc424459f
10
index.html
10
index.html
|
@ -25,8 +25,16 @@
|
||||||
Component: JitsiMeetJS.app.entryPoints.APP
|
Component: JitsiMeetJS.app.entryPoints.APP
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const inIframe = () => {
|
||||||
|
try {
|
||||||
|
return window.self !== window.top;
|
||||||
|
} catch (e) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const isElectron = navigator.userAgent.includes('Electron');
|
const isElectron = navigator.userAgent.includes('Electron');
|
||||||
const shouldRegisterWorker = !isElectron && 'serviceWorker' in navigator;
|
const shouldRegisterWorker = !isElectron && !inIframe() && 'serviceWorker' in navigator;
|
||||||
|
|
||||||
if (shouldRegisterWorker) {
|
if (shouldRegisterWorker) {
|
||||||
navigator.serviceWorker
|
navigator.serviceWorker
|
||||||
|
|
Loading…
Reference in New Issue