1 /* -*- Mode: IDL; tab-width: 1; 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://fetch.spec.whatwg.org/#request-class
10 typedef (Request or USVString) RequestInfo;
11 typedef unsigned long nsContentPolicyType;
13 [Exposed=(Window,Worker)]
16 constructor(RequestInfo input, optional RequestInit init = {});
18 readonly attribute ByteString method;
19 readonly attribute USVString url;
20 [SameObject, BinaryName="headers_"] readonly attribute Headers headers;
22 readonly attribute RequestDestination destination;
23 readonly attribute USVString referrer;
24 [BinaryName="referrerPolicy_"]
25 readonly attribute ReferrerPolicy referrerPolicy;
26 readonly attribute RequestMode mode;
27 readonly attribute RequestCredentials credentials;
28 readonly attribute RequestCache cache;
29 readonly attribute RequestRedirect redirect;
30 readonly attribute DOMString integrity;
32 // If a main-thread fetch() promise rejects, the error passed will be a
35 readonly attribute boolean mozErrors;
37 [BinaryName="getOrCreateSignal"]
38 readonly attribute AbortSignal signal;
41 NewObject] Request clone();
43 // Bug 1124638 - Allow chrome callers to set the context.
45 undefined overrideContentPolicyType(nsContentPolicyType context);
47 Request includes Body;
49 // <https://fetch.spec.whatwg.org/#requestinit>.
50 dictionary RequestInit {
55 ReferrerPolicy referrerPolicy;
57 RequestCredentials credentials;
59 RequestRedirect redirect;
67 [Pref="dom.fetchObserver.enabled"]
68 ObserverCallback observe;
71 enum RequestDestination {
73 "audio", "audioworklet", "document", "embed", "font", "frame", "iframe",
74 "image", "manifest", "object", "paintworklet", "report", "script",
75 "sharedworker", "style", "track", "video", "worker", "xslt"
78 enum RequestMode { "same-origin", "no-cors", "cors", "navigate" };
79 enum RequestCredentials { "omit", "same-origin", "include" };
80 enum RequestCache { "default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached" };
81 enum RequestRedirect { "follow", "error", "manual" };
82 enum RequestPriority { "high" , "low" , "auto" };