W3cubDocs

/Web APIs

WindowClient: navigate() method

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.

Syntax

js

navigate(url)

Parameters

url

The location to navigate to.

Return value

A Promise that resolves to the existing WindowClient if the URL is from the same origin as the service worker, or null otherwise.

Specifications

Browser compatibility

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 16
11.1–16This method exists, but always throws NotSupportedError.
42 49 50 36 16
11.3–16This method exists, but always throws NotSupportedError.
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