--- title: Window.URL slug: conflicting/Web/API/URL translation_of: Web/API/URL translation_of_original: Web/API/Window/URL original_slug: Web/API/Window/URL ---
{{ApiRef("Window")}}{{SeeCompatTable}}
La propriété Window.URL
retourne un objet qui fournit les méthodes statiques utilisées pour créer et gérer les objets URLs. On peut aussi l'appeler comme uns constructeur pour instancier des objets {{domxref("URL")}}.
{{AvailableInWorkers}}
Utilisation de la méthode statique:
img.src = URL.{{domxref("URL.createObjectURL", "createObjectURL")}}(blob);
Utilisation d'un objet instancié:
var url = new {{domxref("URL.URL", "URL")}}("../cats/", "https://www.example.com/dogs/");
Specification | Status | Comment |
---|---|---|
{{SpecName('URL', '#dom-url', 'URL')}} | {{Spec2('URL')}} | Initial definition |
{{CompatibilityTable}}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | 8.0[2] | {{CompatGeckoDesktop("2.0")}}[1] {{CompatGeckoDesktop("19.0")}} |
10.0 | 15.0[2] | 6.0[2] 7.0 |
Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}}[2] | {{CompatGeckoMobile("14.0")}}[1] {{CompatGeckoMobile("19.0")}} |
{{CompatVersionUnknown}} | 15.0[2] | 6.0[2] |
[1] From Gecko 2 (Firefox 4) to Gecko 18 included, Gecko returned an object with the non-standard nsIDOMMozURLProperty
internal type. In practice, this didn't make any difference.
[2] Implemented under the non-standard name webkitURL
.