summaryrefslogtreecommitdiff
path: root/src/bg/ReportingCSP.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/bg/ReportingCSP.js')
-rw-r--r--src/bg/ReportingCSP.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/bg/ReportingCSP.js b/src/bg/ReportingCSP.js
new file mode 100644
index 0000000..f8764e8
--- /dev/null
+++ b/src/bg/ReportingCSP.js
@@ -0,0 +1,20 @@
+"use strict";
+
+function ReportingCSP(reportURI, reportGroup) {
+ return Object.assign(
+ new CapsCSP(new NetCSP(
+ `report-uri ${reportURI};`,
+ `;report-to ${reportGroup};`
+ )),
+ {
+ reportURI,
+ reportGroup,
+ reportToHeader: {
+ name: "Report-To",
+ value: JSON.stringify({ "url": reportURI,
+ "group": reportGroup,
+ "max-age": 10886400 }),
+ }
+ }
+ );
+}