--- title: WindowClient.navigate() slug: Web/API/WindowClient/navigate translation_of: Web/API/WindowClient/navigate ---
{{SeeCompatTable}}{{APIRef("Service Workers API")}}
{{domxref("WindowClient")}} 接口的 navigate()
方法加载特定的 URL 地址到一个被控制的浏览器页面,并返回一个当前 {{domxref("WindowClient")}} 议的 {{jsxref("Promise")}} 对象。
WindowClient.navigate(url).then(function(WindowClient) { // do something with your WindowClient after navigation });
url
一个 {{domxref("WindowClient")}}决议的{{jsxref("Promise")}}对象。
Specification | Status | Comment |
---|---|---|
{{SpecName('Service Workers', '#client-navigate-method', 'navigate()')}} | {{Spec2('Service Workers')}} | Initial definition. |