FetchEvent

FetchEvent

package js-html

extends ExtendableEventEvent

Available on js

The parameter passed into the ServiceWorkerGlobalScope.onfetch handler, FetchEvent represents a fetch action that is dispatched on the ServiceWorkerGlobalScope of a ServiceWorker. It contains information about the request and resulting response, and provides the FetchEvent.respondWith() method, which allows us to provide an arbitrary response back to the controlled page.

Documentation FetchEvent by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See:

Constructor

new (type:String, eventInitDict:FetchEventInit)

Throws:

null DOMError

Variables

read only clientId:String

Returns the id of the client that the current service worker is controlling.

read only isReload:Bool

Returns a Boolean that is true if the event was dispatched with the user's intention for the page to reload, and false otherwise. Typically, pressing the refresh button in a browser is a reload, while clicking a link and pressing the back button is not.

read only request:Request

Returns the Request that triggered the event handler.

Methods

respondWith (r:Promise<Response>):Void

Throws:

null DOMError

© 2005–2016 Haxe Foundation
Licensed under a MIT license.
http://api.haxe.org/js/html/FetchEvent.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部