summaryrefslogtreecommitdiff
path: root/src/content/content.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/content.js')
-rw-r--r--src/content/content.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/content/content.js b/src/content/content.js
index 74e1d95..3862a58 100644
--- a/src/content/content.js
+++ b/src/content/content.js
@@ -32,7 +32,19 @@ var seen = {
Messages.addHandler({
seen(event) {
- let {allowed, policyType, request, ownFrame} = event;
+ let {allowed, policyType, request, ownFrame, serviceWorker} = event;
+ if (serviceWorker) {
+ for (let e of seen.list) {
+ let {request} = e;
+ if (e.serviceWorker === serviceWorker ||
+ (request.type === "main_frame" || request.type === "sub_frame") &&
+ new URL(request.url).origin === serviceWorker) {
+ seen.record(event);
+ break;
+ }
+ }
+ return;
+ }
if (window.top === window) {
seen.record(event);
}