mirror of
https://github.com/smittix/intercept.git
synced 2026-04-24 22:59:59 -07:00
Improve mode transitions and add nav perf instrumentation
This commit is contained in:
@@ -18,6 +18,18 @@
|
||||
if (menuLink) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
try {
|
||||
const target = new URL(menuLink.href, window.location.href);
|
||||
if (window.InterceptNavPerf && typeof window.InterceptNavPerf.markStart === 'function') {
|
||||
window.InterceptNavPerf.markStart({
|
||||
targetPath: target.pathname,
|
||||
trigger: 'global-nav',
|
||||
sourceMode: document.body?.getAttribute('data-mode') || null,
|
||||
});
|
||||
}
|
||||
} catch (_) {
|
||||
// Ignore malformed link targets.
|
||||
}
|
||||
window.location.href = menuLink.href;
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user