-
Notifications
You must be signed in to change notification settings - Fork 22.4k
/
index.md
36 lines (24 loc) · 866 Bytes
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
---
title: "WindowClient: navigate() method"
short-title: navigate()
slug: Web/API/WindowClient/navigate
page-type: web-api-instance-method
browser-compat: api.WindowClient.navigate
---
{{APIRef("Service Workers API")}}{{AvailableInWorkers("service")}}
The **`navigate()`** method of the {{domxref("WindowClient")}}
interface loads a specified URL into a controlled client page then returns a
{{jsxref("Promise")}} that resolves to the existing {{domxref("WindowClient")}}.
## Syntax
```js-nolint
navigate(url)
```
### Parameters
- `url`
- : The location to navigate to.
### Return value
A {{jsxref("Promise")}} that resolves to the existing {{domxref("WindowClient")}} if the URL is from the same origin as the service worker, or {{jsxref("Operators/null", "null")}} otherwise.
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}