The navigate()
method of the WindowClient
interface loads a specified URL into a controlled client page then returns a Promise
that resolves to the existing WindowClient
.
The navigate()
method of the WindowClient
interface loads a specified URL into a controlled client page then returns a Promise
that resolves to the existing WindowClient
.
js
navigate(url)
url
The location to navigate to.
A Promise
that resolves to the existing WindowClient
if the URL is from the same origin as the service worker, or null
otherwise.
Specification |
---|
Service Workers # client-navigate |
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
navigate |
49 | 17 | 50 | No | 36 | 1611.1–16This method exists, but always throwsNotSupportedError . |
42 | 49 | 50 | 36 | 1611.3–16This method exists, but always throwsNotSupportedError . |
4.0 |
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/WindowClient/navigate