fix: add service worker to check

This commit is contained in:
Derrick Hammer 2023-09-11 08:40:00 -04:00
parent 1952aea355
commit c2be4fe886
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 3 additions and 1 deletions

View File

@ -121,6 +121,8 @@ function handleMessage(event: MessageEvent) {
event.origin === EXTENSION_KERNEL_ORIGIN &&
IS_EXTENSION_ANY;
const FROM_SW = event.source === serviceWorker;
const FROM_HOSTED_KERNEL =
event.source !== window && event.origin === EXTENSION_HOSTED_ORIGIN;
@ -130,7 +132,7 @@ function handleMessage(event: MessageEvent) {
event.data = Object.assign({}, event);
}
if (!FROM_KERNEL && !FROM_HOSTED_KERNEL && !bgConn) {
if (!FROM_KERNEL && !FROM_HOSTED_KERNEL && !bgConn && !FROM_SW) {
return;
}