diff options
author | hackademix | 2020-01-08 12:54:50 +0100 |
---|---|---|
committer | hackademix | 2020-01-08 12:54:50 +0100 |
commit | bd5acb2be3bac7cb22f8b2828b0f950af22b1f37 (patch) | |
tree | 2b2552af7ad047bffc53c51314f354d4c46a2327 /src/content | |
parent | ce6e5a54a00322332188eddc2a358288db7d20c3 (diff) | |
download | noscript-bd5acb2be3bac7cb22f8b2828b0f950af22b1f37.tar.gz noscript-bd5acb2be3bac7cb22f8b2828b0f950af22b1f37.tar.xz noscript-bd5acb2be3bac7cb22f8b2828b0f950af22b1f37.zip |
Support for reporting service workers and their imported scripts in UI.
Diffstat (limited to 'src/content')
-rw-r--r-- | src/content/content.js | 14 |
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); } |