NavigationTransition

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

实验性: 这是一项实验性技术
在将其用于生产之前,请仔细检查浏览器兼容性表格

导航 APINavigationTransition 接口表示正在进行的导航,即尚未到达 navigatesuccessnavigateerror 阶段的导航。

它是通过 Navigation.transition 属性访问的。

实例属性

finished 只读 实验性

返回一个 Promise,其在 navigatesuccess 事件触发的同时兑现,或 navigateerror 事件触发的同时拒绝。

from 只读 实验性

返回导航过渡来源的 NavigationHistoryEntry

返回正在进行的导航的类型。

示例

js
async function cleanupNavigation() {
  await navigation.transition.finished;
  // 导航已成功完成
  // 清理所有正在进行的监控
}

规范

Specification
HTML
# navigationtransition

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
NavigationTransition
Experimental
finished
Experimental
from
Experimental
navigationType
Experimental

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.
See implementation notes.

参见