1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
6 * The origin of this IDL file is
7 * https://w3c.github.io/reporting/#interface-reporting-observer
10 [Pref="dom.reporting.enabled",
12 interface ReportBody {
15 [Pref="dom.reporting.enabled",
18 readonly attribute DOMString type;
19 readonly attribute DOMString url;
20 readonly attribute ReportBody? body;
23 [Pref="dom.reporting.enabled",
25 interface ReportingObserver {
27 constructor(ReportingObserverCallback callback,
28 optional ReportingObserverOptions options = {});
32 ReportList takeRecords();
35 callback ReportingObserverCallback = void (sequence<Report> reports, ReportingObserver observer);
37 dictionary ReportingObserverOptions {
38 sequence<DOMString> types;
39 boolean buffered = false;
42 typedef sequence<Report> ReportList;
44 [Pref="dom.reporting.enabled",
46 interface DeprecationReportBody : ReportBody {
47 readonly attribute DOMString id;
48 // The spec currently has Date, but that's not a type that exists in Web IDL.
49 // In any case, we always return null, so we just need _some_ nullable type
51 readonly attribute DOMTimeStamp? anticipatedRemoval;
52 readonly attribute DOMString message;
53 readonly attribute DOMString? sourceFile;
54 readonly attribute unsigned long? lineNumber;
55 readonly attribute unsigned long? columnNumber;
58 [Deprecated="DeprecatedTestingInterface",
59 Pref="dom.reporting.testing.enabled",
60 Exposed=(Window,DedicatedWorker)]
61 interface TestingDeprecatedInterface {
64 [Deprecated="DeprecatedTestingMethod"]
65 void deprecatedMethod();
67 [Deprecated="DeprecatedTestingAttribute"]
68 readonly attribute boolean deprecatedAttribute;
71 // Used internally to process the JSON
73 dictionary ReportingHeaderValue {
74 sequence<ReportingItem> items;
77 // Used internally to process the JSON
78 dictionary ReportingItem {
81 // This is a sequence of ReportingEndpoint.
83 // This is a string. If missing, the value is 'default'.
85 boolean include_subdomains = false;
88 // Used internally to process the JSON
90 dictionary ReportingEndpoint {
93 // This is an unsigned long.
95 // This is an unsigned long.