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:
parent
571f04074a
commit
9d0012edad
@ -92,12 +92,12 @@ export function useTakeover(wsSend: (msg: any) => void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function viewport() {
|
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 }) {
|
function navigate(args: { url: string }) {
|
||||||
window.location.hash = args.hash;
|
window.location.href = args.url;
|
||||||
return { navigated: args.hash };
|
return { navigated: args.url };
|
||||||
}
|
}
|
||||||
|
|
||||||
function reload() {
|
function reload() {
|
||||||
@ -280,6 +280,8 @@ export function useTakeover(wsSend: (msg: any) => void) {
|
|||||||
return;
|
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}` });
|
sendResult({ type: 'dev_cmd_result', cmdId, error: `Unknown command: ${cmd}` });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user