fix(iframe) don't register service worker when in an iframe

Fixes: https://github.com/jitsi/jitsi-meet/issues/9712
pull/9795/head jitsi-meet_6222
Saúl Ibarra Corretgé 4 years ago committed by Saúl Ibarra Corretgé
parent 605ce9db62
commit 5bc424459f
  1. 10
      index.html

@ -25,8 +25,16 @@
Component: JitsiMeetJS.app.entryPoints.APP
})
const inIframe = () => {
try {
return window.self !== window.top;
} catch (e) {
return true;
}
};
const isElectron = navigator.userAgent.includes('Electron');
const shouldRegisterWorker = !isElectron && 'serviceWorker' in navigator;
const shouldRegisterWorker = !isElectron && !inIframe() && 'serviceWorker' in navigator;
if (shouldRegisterWorker) {
navigator.serviceWorker

Loading…
Cancel
Save