Bug 1807268 - Fix verifyOpenAllInNewTabsOptionTest UI test r=ohorvath
[gecko.git] / uriloader / prefetch / nsIPrefetchService.idl
blob160d0511166f35a893f97f8f2a1fe7ed80fc11b3
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
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #include "nsISupports.idl"
6 #include "nsIContentPolicy.idl"
8 interface nsIURI;
9 interface nsISimpleEnumerator;
10 interface nsIReferrerInfo;
12 webidl Node;
14 [scriptable, uuid(422a1807-4e7f-463d-b8d7-ca2ceb9b5d53)]
15 interface nsIPrefetchService : nsISupports
17 /**
18 * Enqueue a request to prefetch the specified URI.
20 * @param aURI the URI of the document to prefetch
21 * @param aReferrerInfo the referrerInfo of the request
22 * @param aSource the DOM node (such as a <link> tag) that requested this
23 * fetch, or null if the prefetch was not requested by a DOM node.
24 * @param aExplicit the link element has an explicit prefetch link type
26 void prefetchURI(in nsIURI aURI,
27 in nsIReferrerInfo aReferrerInfo,
28 in Node aSource,
29 in boolean aExplicit);
31 /**
32 * Start a preload of the specified URI.
34 * @param aURI the URI of the document to preload
35 * @param aReferrerInfo the referrerInfo of the request
36 * @param aSource the DOM node (such as a <link> tag) that requested this
37 * fetch, or null if the prefetch was not requested by a DOM node.
38 * @param aPolicyType content policy to be used for this load.
40 void preloadURI(in nsIURI aURI,
41 in nsIReferrerInfo aReferrerInfo,
42 in Node aSource,
43 in nsContentPolicyType aPolicyType);
45 /**
46 * Find out if there are any prefetches running or queued
48 boolean hasMoreElements();
50 /**
51 * Cancel prefetch or preload for a Node.
53 void cancelPrefetchPreloadURI(in nsIURI aURI, in Node aSource);