URL.webidl (1855B)
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/. 5 * 6 * The origins of this IDL file are 7 * http://url.spec.whatwg.org/#api 8 * https://w3c.github.io/FileAPI/#creating-revoking 9 * 10 * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C 11 * liability, trademark and document use rules apply. 12 */ 13 14 interface URI; 15 16 [Exposed=(Window,Worker,WorkerDebugger), 17 LegacyWindowAlias=webkitURL] 18 interface URL { 19 [Throws] 20 constructor(UTF8String url, optional UTF8String base); 21 22 static URL? parse(UTF8String url, optional UTF8String base); 23 static boolean canParse(UTF8String url, optional UTF8String base); 24 25 [SetterThrows] 26 stringifier attribute UTF8String href; 27 readonly attribute UTF8String origin; 28 attribute UTF8String protocol; 29 attribute UTF8String username; 30 attribute UTF8String password; 31 attribute UTF8String host; 32 attribute UTF8String hostname; 33 attribute UTF8String port; 34 attribute UTF8String pathname; 35 attribute UTF8String search; 36 [SameObject] 37 readonly attribute URLSearchParams searchParams; 38 attribute UTF8String hash; 39 40 [ChromeOnly] 41 readonly attribute URI URI; 42 [ChromeOnly] 43 static URL fromURI(URI uri); 44 45 UTF8String toJSON(); 46 }; 47 48 [Exposed=(Window,DedicatedWorker,SharedWorker)] 49 partial interface URL { 50 [Throws] 51 static UTF8String createObjectURL((Blob or MediaSource) obj); 52 [Throws] 53 static undefined revokeObjectURL(UTF8String url); 54 }; 55 56 [Exposed=(Window,DedicatedWorker,SharedWorker)] 57 partial interface URL { 58 [ChromeOnly, Throws] 59 static boolean isBoundToBlob(UTF8String url); 60 };