Вы читаете английскую версию этой статьи, так как пока нет перевода на данный язык. Помогите нам перевести эту статью!

The password property of the URL interface is a USVString containing the password specified before the domain name.

If it is set without first setting the username property, it silently fails.

Note: This feature is available in Web Workers.


string = object.password;
object.password = string;


A USVString.


var url = new URL('https://anonymous:flabada@developer.mozilla.org/en-US/docs/Web/API/URL/password');
var result = url.password; // Returns:"flabada"


Specification Status Comment
The definition of 'URL.password' in that specification.
Living Standard Initial definition.

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
passwordChrome Full support 52Edge Full support 12Firefox Full support 26IE ? Opera Full support YesSafari Full support 10WebView Android Full support 52Chrome Android Full support 52Firefox Android Full support 26Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes


Full support  
Full support
Compatibility unknown  
Compatibility unknown

See also

  • The URL interface it belongs to.