Files
MyAiDesk/nomifun-tauri/crates/agent/nomi-browser-engine/tests/fixtures/spa-softnav.html
T
freedak f7a720204a Update: 将子项目从 submodule 转为完整内容
- 移除 GovAI, nomifun-tauri, 算力盒子 的 submodule 引用
- 添加所有子项目的完整源代码
- 保留原始 .git 为 .git.bak 备份
2026-07-04 19:20:46 +08:00

30 lines
1.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>D2 SPA soft navigation</title>
</head>
<body>
<h1>SPA fixture</h1>
<button id="go">Go to /step2</button>
<div id="state" role="status">at start</div>
<script>
// 点击即 history.pushState 改 URLsame-document soft navigation,无 newDocument)。
// CDP 据此发 Page.navigatedWithinDocument(不发 frameNavigated/loadEventFired)。
document.getElementById('go').addEventListener('click', function () {
history.pushState({}, '', '/step2');
document.getElementById('state').textContent = 'at step2';
});
// 加载即自动软导航一次(让 navigate 到本页后立即触发 navigatedWithinDocument
// 便于集成测试在不依赖点击的情况下观察 SPA 降级路径)。延迟到下一帧,确保 navigate
// 的初始文档 load 与软导航分离。
window.addEventListener('load', function () {
setTimeout(function () {
history.pushState({}, '', '/auto-soft-nav');
document.getElementById('state').textContent = 'auto soft-nav done';
}, 50);
});
</script>
</body>
</html>