过时
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.
isReload
只读特性在
FetchEvent
interface returns
true
if the event was dispatched by the user attempting to reload the page, and
false
otherwise. Pressing the refresh button is a reload while clicking a link and pressing the back button is not.
var reloaded = FetchEvent.isReload
A
布尔
.
self.addEventListener('fetch', function(event) {
event.respondWith(
if (event.isReload) {
//Return something
} else {
//Return something else
};
);
});
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
isReload
弃用
|
Chrome 45 | Edge 17 |
Firefox
44 — 74
|
IE No | Opera 32 | Safari No | WebView Android 45 | Chrome Android 45 | Firefox Android 44 | Opera Android 32 | Safari iOS No | Samsung Internet Android 5.0 |
完整支持
不支持
实验。期望将来行为有所改变。
弃用。不要用于新网站。
见实现注意事项。
FetchEvent
缓存
CacheStorage
Client
Clients
ExtendableEvent
InstallEvent
Navigator.serviceWorker
NotificationEvent
PeriodicSyncEvent
PeriodicSyncManager
PeriodicSyncRegistration
ServiceWorker
ServiceWorkerContainer
ServiceWorkerGlobalScope
ServiceWorkerRegistration
SyncEvent
SyncManager
SyncRegistration
WindowClient