URL.username

这篇翻译不完整。请帮忙从英语翻译这篇文章

 URL接口的username属性是USVString ,其中包含域名前指定的username 。

Note: 此特性在 Web Worker 中可用。

语法

string = object.username;
object.username = string;

一个 USVString.

例子

var url = new URL("https://anonymous:flabada@developer.mozilla.org/en-US/docs/Web/API/URL/username");
var user = url.username; // 返回:“匿名”

规范

规范 状态 说明
URL
username
Living Standard 初步定义

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
usernameChrome 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

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown

参考

  • 所属的 URL接口。

文档标签和贡献者

此页面的贡献者: gongshun
最后编辑者: gongshun,