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",
11 Exposed=(Window,Worker)]
12 interface ReportBody {
13 [Default] object toJSON
17 [Pref="dom.reporting.enabled",
18 Exposed=(Window,Worker)]
20 [Default] object toJSON
22 readonly attribute DOMString type;
23 readonly attribute DOMString url;
24 readonly attribute ReportBody? body;
27 [Pref="dom.reporting.enabled",
28 Exposed=(Window,Worker)]
29 interface ReportingObserver {
31 constructor(ReportingObserverCallback callback, optional ReportingObserverOptions options = {});
33 undefined disconnect();
34 ReportList takeRecords();
37 callback ReportingObserverCallback = undefined (sequence<Report> reports, ReportingObserver observer);
39 dictionary ReportingObserverOptions {
40 sequence<DOMString> types;
41 boolean buffered = false;
44 typedef sequence<Report> ReportList;
46 [Pref="dom.reporting.enabled",
48 interface DeprecationReportBody : ReportBody {
49 readonly attribute DOMString id;
50 // The spec currently has Date, but that's not a type that exists in Web IDL.
51 // In any case, we always return null, so we just need _some_ nullable type
53 readonly attribute DOMTimeStamp? anticipatedRemoval;
54 readonly attribute DOMString message;
55 readonly attribute DOMString? sourceFile;
56 readonly attribute unsigned long? lineNumber;
57 readonly attribute unsigned long? columnNumber;
60 [Deprecated="DeprecatedTestingInterface",
61 Pref="dom.reporting.testing.enabled",
62 Exposed=(Window,DedicatedWorker)]
63 interface TestingDeprecatedInterface {
66 [Deprecated="DeprecatedTestingMethod"]
67 undefined deprecatedMethod();
69 [Deprecated="DeprecatedTestingAttribute"]
70 readonly attribute boolean deprecatedAttribute;
73 // Used internally to process the JSON
75 dictionary ReportingHeaderValue {
76 sequence<ReportingItem> items;
79 // Used internally to process the JSON
80 dictionary ReportingItem {
83 // This is a sequence of ReportingEndpoint.
85 // This is a string. If missing, the value is 'default'.
87 boolean include_subdomains = false;
90 // Used internally to process the JSON
92 dictionary ReportingEndpoint {
95 // This is an unsigned long.
97 // This is an unsigned long.