Skip to content

Commit 7993f46

Browse files
committed
Coalesce activity reports by origin.
1 parent ab705e3 commit 7993f46

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/content/content.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,12 @@ window.addEventListener("securitypolicyviolation", async e => {
157157
} else {
158158
({origin} = new URL(url));
159159
}
160-
const key = RequestKey.create(url, type, documentOrigin);
160+
const reportUrl = /frame|object|media/.test(type) ? url : origin;
161+
const key = RequestKey.create(reportUrl, type, documentOrigin);
161162
if (violations.has(key)) return;
162163
violations.add(key);
163164
if (type === "frame") type = "sub_frame";
164-
Messages.send("violation", {url, type, isReport});
165+
Messages.send("violation", {url: reportUrl, type, isReport});
165166
}, true);
166167

167168
if (!/^https:/.test(location.protocol)) {

0 commit comments

Comments
 (0)