From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../web/api/serviceworker/scripturl/index.html | 92 ++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 files/zh-cn/web/api/serviceworker/scripturl/index.html (limited to 'files/zh-cn/web/api/serviceworker/scripturl') diff --git a/files/zh-cn/web/api/serviceworker/scripturl/index.html b/files/zh-cn/web/api/serviceworker/scripturl/index.html new file mode 100644 index 0000000000..5b0ce2055d --- /dev/null +++ b/files/zh-cn/web/api/serviceworker/scripturl/index.html @@ -0,0 +1,92 @@ +--- +title: ServiceWorker.scriptURL +slug: Web/API/ServiceWorker/scriptURL +translation_of: Web/API/ServiceWorker/scriptURL +--- +
{{SeeCompatTable}}{{APIRef("Service Workers API")}}
+ +

作为ServiceWorkerRegistration的一部分定义,会返回该ServiceWorker的序列化脚本url. 必须与document注册ServiceWorker的地址同源.

+ +

语法

+ +
someURL = ServiceWorker.scriptURL
+
+ +

+ +

一个 {{domxref("USVString")}} (另见 WebIDL definition of USVString.)

+ +

规范

+ + + + + + + + + + + + + + +
规范状态附注
{{SpecName('Service Workers', '#service-worker-url-attribute', 'scriptURL')}}{{Spec2('Service Workers')}}Initial definition
+ +

浏览器兼容性

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support{{CompatChrome(40.0)}}{{ CompatGeckoDesktop("44.0") }}[1]{{CompatNo}}24{{CompatNo}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidAndroid WebviewFirefox Mobile (Gecko)Firefox OSIE MobileOpera MobileSafari MobileChrome for Android
Basic support{{CompatNo}}{{CompatNo}}{{ CompatGeckoMobile("44.0") }}{{ CompatVersionUnknown }}{{CompatNo}}{{CompatUnknown}}{{CompatNo}}{{CompatChrome(40.0)}}
+
+ +

[1] Service workers (and Push) have been disabled in the Firefox 45 and 52 Extended Support Releases (ESR.)

-- cgit v1.2.3-54-g00ecf