From c2be4fe886cad8210aa04b6c1e55064fce93c9b5 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Mon, 11 Sep 2023 08:40:00 -0400 Subject: [PATCH] fix: add service worker to check --- src/kernel/queries.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/kernel/queries.ts b/src/kernel/queries.ts index bf03edb..b5fd845 100644 --- a/src/kernel/queries.ts +++ b/src/kernel/queries.ts @@ -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; }