SecurityPolicyViolationEvent.webidl (1965B)
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 * 5 * The origin of this IDL file is 6 * https://w3c.github.io/webappsec-csp/#violation-events 7 */ 8 9 enum SecurityPolicyViolationEventDisposition 10 { 11 "enforce", "report" 12 }; 13 14 [Exposed=Window] 15 interface SecurityPolicyViolationEvent : Event 16 { 17 constructor(DOMString type, 18 optional SecurityPolicyViolationEventInit eventInitDict = {}); 19 20 readonly attribute DOMString documentURI; 21 readonly attribute DOMString referrer; 22 readonly attribute DOMString blockedURI; 23 readonly attribute DOMString violatedDirective; // historical alias of effectiveDirective 24 readonly attribute DOMString effectiveDirective; 25 readonly attribute DOMString originalPolicy; 26 readonly attribute DOMString sourceFile; 27 readonly attribute DOMString sample; 28 readonly attribute SecurityPolicyViolationEventDisposition disposition; 29 readonly attribute unsigned short statusCode; 30 readonly attribute unsigned long lineNumber; 31 readonly attribute unsigned long columnNumber; 32 }; 33 34 [GenerateInitFromJSON, GenerateToJSON] 35 dictionary SecurityPolicyViolationEventInit : EventInit 36 { 37 DOMString documentURI = ""; 38 DOMString referrer = ""; 39 DOMString blockedURI = ""; 40 DOMString violatedDirective = ""; 41 DOMString effectiveDirective = ""; 42 DOMString originalPolicy = ""; 43 // TODO: We could avoid some string copies if these were USVStrings or 44 // UTF8Strings, see https://github.com/w3c/webappsec-csp/issues/674 45 DOMString sourceFile = ""; 46 DOMString sample = ""; 47 SecurityPolicyViolationEventDisposition disposition = "enforce"; 48 unsigned short statusCode = 0; 49 unsigned long lineNumber = 0; 50 unsigned long columnNumber = 0; 51 };