Fixed missing frameId on interception reporting.

This commit is contained in:
hackademix 2024-09-11 13:09:59 +02:00
parent 3a04212a4f
commit d7bb06f67f
No known key found for this signature in database
GPG Key ID: 231A83AFDA9C2434
1 changed files with 2 additions and 1 deletions

View File

@ -25,6 +25,7 @@ var RequestGuard = (() => {
const CSP_REPORT_URI = "https://noscript-csp.invalid/__NoScript_Probe__/"; const CSP_REPORT_URI = "https://noscript-csp.invalid/__NoScript_Probe__/";
const CSP_MARKER = "noscript-marker"; const CSP_MARKER = "noscript-marker";
let csp = new ReportingCSP(CSP_MARKER, CSP_REPORT_URI); let csp = new ReportingCSP(CSP_MARKER, CSP_REPORT_URI);
const policyTypesMap = { const policyTypesMap = {
main_frame: "", main_frame: "",
sub_frame: "frame", sub_frame: "frame",
@ -40,7 +41,6 @@ var RequestGuard = (() => {
media: "media", media: "media",
other: "", other: "",
}; };
// add "fake" mappings for reporting capabilities handled outside of RequestGuard // add "fake" mappings for reporting capabilities handled outside of RequestGuard
for (const cap of Permissions.ALL) { for (const cap of Permissions.ALL) {
if (!(cap in policyTypesMap)) { if (!(cap in policyTypesMap)) {
@ -247,6 +247,7 @@ var RequestGuard = (() => {
const tabId = sender.tab.id; const tabId = sender.tab.id;
for (const {request, allowed, policyType} of message.seen) { for (const {request, allowed, policyType} of message.seen) {
request.tabId = tabId; request.tabId = tabId;
request.frameId = sender.frameId;
Content.reportTo(request, allowed, policyType); Content.reportTo(request, allowed, policyType);
} }
} }