1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5enum SecurityPolicyViolationEventDisposition
6{
7  "enforce", "report"
8};
9
10[Constructor(DOMString type, optional SecurityPolicyViolationEventInit eventInitDict),
11 Pref="security.csp.enable_violation_events"]
12interface SecurityPolicyViolationEvent : Event
13{
14    readonly attribute DOMString      documentURI;
15    readonly attribute DOMString      referrer;
16    readonly attribute DOMString      blockedURI;
17    readonly attribute DOMString      violatedDirective;
18    readonly attribute DOMString      effectiveDirective;
19    readonly attribute DOMString      originalPolicy;
20    readonly attribute DOMString      sourceFile;
21    readonly attribute DOMString      sample;
22    readonly attribute SecurityPolicyViolationEventDisposition disposition;
23    readonly attribute unsigned short statusCode;
24    readonly attribute long           lineNumber;
25    readonly attribute long           columnNumber;
26};
27
28dictionary SecurityPolicyViolationEventInit : EventInit
29{
30    DOMString      documentURI = "";
31    DOMString      referrer = "";
32    DOMString      blockedURI = "";
33    DOMString      violatedDirective = "";
34    DOMString      effectiveDirective = "";
35    DOMString      originalPolicy = "";
36    DOMString      sourceFile = "";
37    DOMString      sample = "";
38    SecurityPolicyViolationEventDisposition disposition = "report";
39    unsigned short statusCode = 0;
40    long           lineNumber = 0;
41    long           columnNumber = 0;
42};
43