From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/api/url/origin/index.html | 112 ++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 files/zh-cn/web/api/url/origin/index.html (limited to 'files/zh-cn/web/api/url/origin') diff --git a/files/zh-cn/web/api/url/origin/index.html b/files/zh-cn/web/api/url/origin/index.html new file mode 100644 index 0000000000..182ae919ea --- /dev/null +++ b/files/zh-cn/web/api/url/origin/index.html @@ -0,0 +1,112 @@ +--- +title: URL.origin +slug: Web/API/URL/origin +translation_of: Web/API/URL/origin +--- +

{{APIRef("URL API")}}

+ +

URL.origin 是一个只读属性,返回一个 {{domxref("USVString")}} 类型值,包含 URL 源经过 Unicode 序列化之后的值, 也就是:

+ + + +

{{AvailableInWorkers}}

+ +

语法

+ +
string = URLObject.origin;
+
+ +

示例

+ +
var result = new URL("blob:https://mozilla.org:443/").origin;
+// 返回:'https://developer.mozilla.org:443'
+
+ +

规范

+ + + + + + + + + + + + + + +
规范?状态备注
{{SpecName('URL', '#dom-url-origin', 'URL.origin')}}{{Spec2('URL')}}Initial definition.
+ +

浏览器支持

+ +

{{ CompatibilityTable() }}

+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatChrome(52)}}{{CompatNo}} [1]{{CompatGeckoDesktop("26.0")}} [2][3]{{CompatNo}} [1]{{CompatNo}} [1]{{CompatNo}} [1]
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroid WebviewChrome for AndroidEdgeFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatChrome(52)}}{{CompatChrome(52)}}{{CompatNo}} [1]{{CompatGeckoMobile("26.0")}} [2][3]{{CompatNo}} [1]{{CompatNo}} [1]{{CompatNo}} [1]
+
+ +

[1] Though not grouped in a single abstract interface, this method is directly available on the interfaces that implement it, if this interface is supported.

+ +

[2] From Gecko 26 to Gecko 44, this property was on the URLUtils mixin. It has been moves either on the HTMLHyperlinkElementUtils mixin, or directly on the interface.

+ +

[3] Before Gecko 49, results for URL using the blob scheme incorrectly returned null.

+ +

See also

+ + -- cgit v1.2.3-54-g00ecf