We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

Перевод не завершен. Пожалуйста, помогите перевести эту статью с английского.

Это экспериментальная технология
Так как спецификация этой технологии ещё не стабилизировалась, смотрите таблицу совместимости по поводу использования в различных браузерах. Также заметьте, что синтаксис и поведение экспериментальной технологии может измениться в будущих версиях браузеров, вслед за изменениями спецификации.

The URL interface represent an object providing static methods used for creating object URLs.

When using a user agent where no constructor has been implemented yet, it is possible to access such an object using the Window.URL properties (prefixed with Webkit-based browser as Window.webkitURL).

Примечание: Эта возможность доступна в Web Workers.


Implements properties defined in URLUtils.

Is a DOMString containing the whole URL.
Is a DOMString containing the protocol scheme of the URL, including the final ':'.
Is a DOMString containing the host, that is the hostname, a ':', and the port of the URL.
Is a DOMString containing the domain of the URL.
Is a DOMString containing the port number of the URL.
Is a DOMString containing an initial '/' followed by the path of the URL.
Is a DOMString containing a '?' followed by the parameters of the URL.
Is a DOMString containing a '#' followed by the fragment identifier of the URL.
Is a DOMString containing the username specified before the domain name.
Is a DOMString containing the password specified before the domain name.
URLUtils.origin Только для чтения
Returns a DOMString containing the origin of the URL, that is its scheme, its domain and its port.
Returns a URLSearchParams object allowing to access the GET query arguments contained in the URL.


Creates and return a URL object composed from the given parameters.


The URL interface implements methods defined in URLUtils.

Returns a DOMString containing the whole URL. It is a synonym for URLUtils.href, though it can't be used to modify the value.

Static methods

Returns a DOMString containing a unique blob URL, that is a URL with blob: as its scheme, followed by an opaque string uniquely identifying the object in the browser.
Revokes an object URL previously created using URL.createObjectURL().


Specification Status Comment
File API
Определение 'URL' в этой спецификации.
Рабочий черновик Added the static methods URL.createObjectURL() and URL.revokeObjectURL().
Определение 'Node' в этой спецификации.
Живой стандарт Initial definition (implements URLUtils).

Browser compatibility

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari
Basic support 8.0[2]
? 4.0 (2.0)[1]
19.0 (19.0)
10.0 15.0[2]
username, password, and origin 32 ? 26.0 (26.0) ? 19 (Да)
searchParams 49 ? 29.0 (29.0) ? 36 Нет
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support 4[2]
14.0 (14.0)[1]
19.0 (19.0)
(Да) 15.0[2] 6.0[2]
username, password, and origin 4.4 32 26.0 (26.0) ? ? (Да)
searchParams Нет 49 29.0 (29.0) ? ? ?

[1] From Gecko 2 (Firefox 4) to Gecko 18 included, Gecko supported this interface with the non-standard nsIDOMMozURLProperty internal type. As the only to access such an object was through window.URL, in practice, this didn't make any difference.

[2] This feature is implemented under the non-standard name webkitURL.

Chrome Code - Scope Availability

To use from chrome code, JSM and Bootstrap scope, you have to import it like this:


URL is available in Worker scopes.

See also

Метки документа и участники

Внесли вклад в эту страницу: Gheoan
Обновлялась последний раз: Gheoan,