NavigationCurrentEntryChangeEvent:from 属性
Baseline
2026
Newly available
Since January 2026, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
NavigationCurrentEntryChangeEvent 接口的 from 只读属性返回导航来源的 NavigationHistoryEntry。
值
示例
js
navigation.addEventListener("currententrychange", (event) => {
console.log(event.from);
});
规范
| Specification |
|---|
| HTML> # dom-navigationcurrententrychangeevent-from-dev> |
浏览器兼容性
参见
- 现代客户端路由:导航 API
- 导航 API 说明
- Domenic Denicola 的导航 API 在线演示