fix(takeover): navigate uses full URL, viewport returns url not hash

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Nico 2026-04-03 23:05:54 +02:00
parent 571f04074a
commit 9d0012edad

View File

@ -92,12 +92,12 @@ export function useTakeover(wsSend: (msg: any) => void) {
}
function viewport() {
return { w: window.innerWidth, h: window.innerHeight, dpr: window.devicePixelRatio, hash: window.location.hash };
return { w: window.innerWidth, h: window.innerHeight, dpr: window.devicePixelRatio, url: window.location.href };
}
function navigate(args: { hash: string }) {
window.location.hash = args.hash;
return { navigated: args.hash };
function navigate(args: { url: string }) {
window.location.href = args.url;
return { navigated: args.url };
}
function reload() {
@ -280,6 +280,8 @@ export function useTakeover(wsSend: (msg: any) => void) {
return;
}
// ext_* commands are handled by the Chrome extension — ignore silently
if (cmd.startsWith('ext_')) return;
sendResult({ type: 'dev_cmd_result', cmdId, error: `Unknown command: ${cmd}` });
}