This is an experimental technology
Because this technology's specification has not stabilized, check the compatibility table for usage in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the specification changes.
The handleEvent() method of the ObserverCallback interface runs when the associated fetch request runs, providing a FetchObserver object to observe the fetch.
You would never run this function yourself, rather it would be run internally as a result of an observe parameter being defined on a fetch request init object.
Syntax
observe(observer);
Parameters
A FetchObserver object.
Return value
Void.
Examples
Again, you would never run this method by yourself. Refer to the FetchObserver page for a valid observer usage example
Specifications
Not part of a specification yet.
Browser compatibility
| Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
|---|---|---|---|---|---|---|
| Basic support |
No support |
No support | No support[1] | No support |
No support |
No support |
| Feature | Android | Android Webview | Edge | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile | Chrome for Android |
|---|---|---|---|---|---|---|---|---|
| Basic support | No support | No support | No support | No support[1] | No support | No support | No support | No support |
[1] Hidden behind a preference in 55+ Nightly. In about:config, you need to create two new boolean prefs — dom.fetchObserver.enabled and dom.fetchController.enabled — and set the values of both to true.