authorgravatar for maria@kuuro.netmaria <maria@kuuro.net> 2026-09-04 21:10:18-04:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-04 21:10:18-04:00
logb5fb3fba0fb3dbd1bc2e29886232321cc06863d5
treee8fecb44c22c7b622671fa3be5fb681be5feb75f
parent2dca7a1eddd27c823e4d9d0a316864c4ad9f95c5
signature Signed by PGP key B5690EEEBB952194

fix(desktop): isolate preview keyboard shortcuts from the host (#9840)


2 files changed, 87 insertions(+), 47 deletions(-)

apps/desktop/src/preview/Manager.test.ts+83
...@@ -272,6 +272,7 @@ const makeTestPreviewWebContents = (...@@ -272,6 +272,7 @@ const makeTestPreviewWebContents = (
272 ipc: { on: vi.fn(), off: vi.fn() },272 ipc: { on: vi.fn(), off: vi.fn() },
273 send: webviewSend,273 send: webviewSend,
274 navigationHistory: { canGoBack: () => false, canGoForward: () => false },274 navigationHistory: { canGoBack: () => false, canGoForward: () => false },
275 setIgnoreMenuShortcuts: vi.fn(),
275 setWindowOpenHandler: vi.fn(),276 setWindowOpenHandler: vi.fn(),
276 debugger: {277 debugger: {
277 isAttached: () => false,278 isAttached: () => false,
...@@ -382,6 +383,7 @@ const makeFaviconWebContents = (options?: {...@@ -382,6 +383,7 @@ const makeFaviconWebContents = (options?: {
382 send: webviewSend,383 send: webviewSend,
383 session: { fetch },384 session: { fetch },
384 navigationHistory: { canGoBack: () => false, canGoForward: () => false },385 navigationHistory: { canGoBack: () => false, canGoForward: () => false },
386 setIgnoreMenuShortcuts: vi.fn(),
385 setWindowOpenHandler: vi.fn(),387 setWindowOpenHandler: vi.fn(),
386 executeJavaScriptInIsolatedWorld,388 executeJavaScriptInIsolatedWorld,
387 debugger: {389 debugger: {
...@@ -474,6 +476,67 @@ describe("PreviewManager", () => {...@@ -474,6 +476,67 @@ describe("PreviewManager", () => {
474 webviewSend.mockClear();476 webviewSend.mockClear();
475 });477 });
476478
479 effectIt.effect("keeps preview shortcuts out of the host window", () =>
480 withManager((manager) =>
481 Effect.gen(function* () {
482 const preview = makeFaviconWebContents();
483 const sendInputEvent = vi.fn();
484 const hostWebContents = { sendInputEvent };
485 Object.assign(preview.webContents, { hostWebContents });
486 fromId.mockReturnValue(preview.webContents);
487 yield* manager.setMainWindow({
488 isDestroyed: () => false,
489 once: vi.fn(),
490 webContents: hostWebContents,
491 } as never);
492 yield* manager.createTab("tab_keys");
493 yield* manager.registerWebview("tab_keys", 42);
494
495 expect(
496 (preview.webContents as Electron.WebContents).setIgnoreMenuShortcuts,
497 ).toHaveBeenCalledWith(true);
498 const beforeInput = preview.listeners.get("before-input-event")!;
499 for (const control of [false, true]) {
500 for (const key of ["k", ",", "w", "j", "q", "+", "a", "c", "v", "x"]) {
501 for (const type of ["keyDown", "keyUp"]) {
502 const preventDefault = vi.fn();
503 beforeInput(
504 { preventDefault } as never,
505 { type, key, meta: !control, control, shift: key === "j", alt: false } as never,
506 );
507 yield* Effect.yieldNow;
508 expect(preventDefault).not.toHaveBeenCalled();
509 }
510 }
511 }
512 expect(sendInputEvent).not.toHaveBeenCalled();
513
514 const preventDefault = vi.fn();
515 beforeInput(
516 { preventDefault } as never,
517 {
518 type: "keyDown",
519 key: "r",
520 meta: true,
521 control: false,
522 shift: false,
523 alt: false,
524 } as never,
525 );
526 yield* Effect.yieldNow;
527 expect(preventDefault).toHaveBeenCalledOnce();
528 expect(preview.reload).toHaveBeenCalledOnce();
529 expect(sendInputEvent).not.toHaveBeenCalled();
530
531 const setIgnoreMenuShortcuts = vi.fn();
532 preview.listeners.get("did-create-window")!({
533 webContents: { setIgnoreMenuShortcuts, setWindowOpenHandler: vi.fn() },
534 } as never);
535 expect(setIgnoreMenuShortcuts).toHaveBeenCalledWith(true);
536 }),
537 ),
538 );
539
477 effectIt.effect("reports an unregistered webview as temporarily unavailable", () =>540 effectIt.effect("reports an unregistered webview as temporarily unavailable", () =>
478 withManager((manager) =>541 withManager((manager) =>
479 Effect.gen(function* () {542 Effect.gen(function* () {
...@@ -617,6 +680,7 @@ describe("PreviewManager", () => {...@@ -617,6 +680,7 @@ describe("PreviewManager", () => {
617 ipc: { on: vi.fn(), off: vi.fn() },680 ipc: { on: vi.fn(), off: vi.fn() },
618 send: webviewSend,681 send: webviewSend,
619 navigationHistory: { canGoBack: () => false, canGoForward: () => false },682 navigationHistory: { canGoBack: () => false, canGoForward: () => false },
683 setIgnoreMenuShortcuts: vi.fn(),
620 setWindowOpenHandler: vi.fn(),684 setWindowOpenHandler: vi.fn(),
621 debugger: {685 debugger: {
622 isAttached: () => false,686 isAttached: () => false,
...@@ -718,6 +782,7 @@ describe("PreviewManager", () => {...@@ -718,6 +782,7 @@ describe("PreviewManager", () => {
718 ipc: { on: vi.fn(), off: vi.fn() },782 ipc: { on: vi.fn(), off: vi.fn() },
719 send: webviewSend,783 send: webviewSend,
720 navigationHistory: { canGoBack: () => false, canGoForward: () => false },784 navigationHistory: { canGoBack: () => false, canGoForward: () => false },
785 setIgnoreMenuShortcuts: vi.fn(),
721 setWindowOpenHandler: vi.fn(),786 setWindowOpenHandler: vi.fn(),
722 get debugger() {787 get debugger() {
723 if (destroyed) throw new Error("Object has been destroyed");788 if (destroyed) throw new Error("Object has been destroyed");
...@@ -1222,6 +1287,7 @@ describe("PreviewManager", () => {...@@ -1222,6 +1287,7 @@ describe("PreviewManager", () => {
1222 ipc: { on: vi.fn(), off: vi.fn() },1287 ipc: { on: vi.fn(), off: vi.fn() },
1223 send: webviewSend,1288 send: webviewSend,
1224 navigationHistory: { canGoBack: () => false, canGoForward: () => false },1289 navigationHistory: { canGoBack: () => false, canGoForward: () => false },
1290 setIgnoreMenuShortcuts: vi.fn(),
1225 setWindowOpenHandler: vi.fn(),1291 setWindowOpenHandler: vi.fn(),
1226 debugger: {1292 debugger: {
1227 isAttached: () => false,1293 isAttached: () => false,
...@@ -1286,6 +1352,7 @@ describe("PreviewManager", () => {...@@ -1286,6 +1352,7 @@ describe("PreviewManager", () => {
1286 ipc: { on: vi.fn(), off: vi.fn() },1352 ipc: { on: vi.fn(), off: vi.fn() },
1287 send: webviewSend,1353 send: webviewSend,
1288 navigationHistory: { canGoBack: () => false, canGoForward: () => false },1354 navigationHistory: { canGoBack: () => false, canGoForward: () => false },
1355 setIgnoreMenuShortcuts: vi.fn(),
1289 setWindowOpenHandler: vi.fn(),1356 setWindowOpenHandler: vi.fn(),
1290 debugger: {1357 debugger: {
1291 isAttached: () => false,1358 isAttached: () => false,
...@@ -1326,6 +1393,7 @@ describe("PreviewManager", () => {...@@ -1326,6 +1393,7 @@ describe("PreviewManager", () => {
1326 ipc: { on: vi.fn(), off: vi.fn() },1393 ipc: { on: vi.fn(), off: vi.fn() },
1327 send: webviewSend,1394 send: webviewSend,
1328 navigationHistory: { canGoBack: () => false, canGoForward: () => false },1395 navigationHistory: { canGoBack: () => false, canGoForward: () => false },
1396 setIgnoreMenuShortcuts: vi.fn(),
1329 setWindowOpenHandler: vi.fn(),1397 setWindowOpenHandler: vi.fn(),
1330 debugger: {1398 debugger: {
1331 isAttached: () => false,1399 isAttached: () => false,
...@@ -1372,6 +1440,7 @@ describe("PreviewManager", () => {...@@ -1372,6 +1440,7 @@ describe("PreviewManager", () => {
1372 ipc: { on: vi.fn(), off: vi.fn() },1440 ipc: { on: vi.fn(), off: vi.fn() },
1373 send: webviewSend,1441 send: webviewSend,
1374 navigationHistory: { canGoBack: () => false, canGoForward: () => false },1442 navigationHistory: { canGoBack: () => false, canGoForward: () => false },
1443 setIgnoreMenuShortcuts: vi.fn(),
1375 setWindowOpenHandler: vi.fn(),1444 setWindowOpenHandler: vi.fn(),
1376 debugger: {1445 debugger: {
1377 isAttached: () => false,1446 isAttached: () => false,
...@@ -1427,6 +1496,7 @@ describe("PreviewManager", () => {...@@ -1427,6 +1496,7 @@ describe("PreviewManager", () => {
1427 ipc: { on: vi.fn(), off: vi.fn() },1496 ipc: { on: vi.fn(), off: vi.fn() },
1428 send: webviewSend,1497 send: webviewSend,
1429 navigationHistory: { canGoBack: () => false, canGoForward: () => false },1498 navigationHistory: { canGoBack: () => false, canGoForward: () => false },
1499 setIgnoreMenuShortcuts: vi.fn(),
1430 setWindowOpenHandler: vi.fn(),1500 setWindowOpenHandler: vi.fn(),
1431 debugger: {1501 debugger: {
1432 isAttached: () => false,1502 isAttached: () => false,
...@@ -1524,6 +1594,7 @@ describe("PreviewManager", () => {...@@ -1524,6 +1594,7 @@ describe("PreviewManager", () => {
1524 ipc: { on: vi.fn(), off: vi.fn() },1594 ipc: { on: vi.fn(), off: vi.fn() },
1525 send: webviewSend,1595 send: webviewSend,
1526 navigationHistory: { canGoBack: () => false, canGoForward: () => false },1596 navigationHistory: { canGoBack: () => false, canGoForward: () => false },
1597 setIgnoreMenuShortcuts: vi.fn(),
1527 setWindowOpenHandler: vi.fn(),1598 setWindowOpenHandler: vi.fn(),
1528 debugger: {1599 debugger: {
1529 isAttached: () => false,1600 isAttached: () => false,
...@@ -1859,6 +1930,7 @@ describe("PreviewManager", () => {...@@ -1859,6 +1930,7 @@ describe("PreviewManager", () => {
1859 ipc: { on: vi.fn(), off: vi.fn() },1930 ipc: { on: vi.fn(), off: vi.fn() },
1860 send: webviewSend,1931 send: webviewSend,
1861 navigationHistory: { canGoBack: () => false, canGoForward: () => false },1932 navigationHistory: { canGoBack: () => false, canGoForward: () => false },
1933 setIgnoreMenuShortcuts: vi.fn(),
1862 setWindowOpenHandler: vi.fn(),1934 setWindowOpenHandler: vi.fn(),
1863 debugger: {1935 debugger: {
1864 isAttached: () => false,1936 isAttached: () => false,
...@@ -1951,6 +2023,7 @@ describe("PreviewManager", () => {...@@ -1951,6 +2023,7 @@ describe("PreviewManager", () => {
1951 ipc: { on: vi.fn(), off: vi.fn() },2023 ipc: { on: vi.fn(), off: vi.fn() },
1952 send: webviewSend,2024 send: webviewSend,
1953 navigationHistory: { canGoBack: () => false, canGoForward: () => false },2025 navigationHistory: { canGoBack: () => false, canGoForward: () => false },
2026 setIgnoreMenuShortcuts: vi.fn(),
1954 setWindowOpenHandler: vi.fn(),2027 setWindowOpenHandler: vi.fn(),
1955 debugger: {2028 debugger: {
1956 isAttached: () => false,2029 isAttached: () => false,
...@@ -2368,6 +2441,7 @@ describe("PreviewManager", () => {...@@ -2368,6 +2441,7 @@ describe("PreviewManager", () => {
2368 ipc: { on: vi.fn(), off: vi.fn() },2441 ipc: { on: vi.fn(), off: vi.fn() },
2369 send: webviewSend,2442 send: webviewSend,
2370 navigationHistory: { canGoBack: () => false, canGoForward: () => false },2443 navigationHistory: { canGoBack: () => false, canGoForward: () => false },
2444 setIgnoreMenuShortcuts: vi.fn(),
2371 setWindowOpenHandler: vi.fn(),2445 setWindowOpenHandler: vi.fn(),
2372 debugger: {2446 debugger: {
2373 isAttached: () => false,2447 isAttached: () => false,
...@@ -2670,6 +2744,7 @@ describe("PreviewManager", () => {...@@ -2670,6 +2744,7 @@ describe("PreviewManager", () => {
2670 ipc: { on: vi.fn(), off: vi.fn() },2744 ipc: { on: vi.fn(), off: vi.fn() },
2671 send: webviewSend,2745 send: webviewSend,
2672 navigationHistory: { canGoBack: () => false, canGoForward: () => false },2746 navigationHistory: { canGoBack: () => false, canGoForward: () => false },
2747 setIgnoreMenuShortcuts: vi.fn(),
2673 setWindowOpenHandler: vi.fn(),2748 setWindowOpenHandler: vi.fn(),
2674 debugger: {2749 debugger: {
2675 isAttached: () => false,2750 isAttached: () => false,
...@@ -3173,6 +3248,7 @@ describe("PreviewManager", () => {...@@ -3173,6 +3248,7 @@ describe("PreviewManager", () => {
3173 ipc: { on: vi.fn(), off: vi.fn(), removeListener: vi.fn() },3248 ipc: { on: vi.fn(), off: vi.fn(), removeListener: vi.fn() },
3174 send: webviewSend,3249 send: webviewSend,
3175 navigationHistory: { canGoBack: () => false, canGoForward: () => false },3250 navigationHistory: { canGoBack: () => false, canGoForward: () => false },
3251 setIgnoreMenuShortcuts: vi.fn(),
3176 setWindowOpenHandler: vi.fn(),3252 setWindowOpenHandler: vi.fn(),
3177 debugger: {3253 debugger: {
3178 isAttached: () => false,3254 isAttached: () => false,
...@@ -3228,6 +3304,7 @@ describe("PreviewManager", () => {...@@ -3228,6 +3304,7 @@ describe("PreviewManager", () => {
3228 },3304 },
3229 send: webviewSend,3305 send: webviewSend,
3230 navigationHistory: { canGoBack: () => false, canGoForward: () => false },3306 navigationHistory: { canGoBack: () => false, canGoForward: () => false },
3307 setIgnoreMenuShortcuts: vi.fn(),
3231 setWindowOpenHandler: vi.fn(),3308 setWindowOpenHandler: vi.fn(),
3232 debugger: {3309 debugger: {
3233 isAttached: () => false,3310 isAttached: () => false,
...@@ -3304,6 +3381,7 @@ describe("PreviewManager", () => {...@@ -3304,6 +3381,7 @@ describe("PreviewManager", () => {
3304 },3381 },
3305 send: webviewSend,3382 send: webviewSend,
3306 navigationHistory: { canGoBack: () => false, canGoForward: () => false },3383 navigationHistory: { canGoBack: () => false, canGoForward: () => false },
3384 setIgnoreMenuShortcuts: vi.fn(),
3307 setWindowOpenHandler: vi.fn(),3385 setWindowOpenHandler: vi.fn(),
3308 debugger: {3386 debugger: {
3309 isAttached: () => false,3387 isAttached: () => false,
...@@ -3389,6 +3467,7 @@ describe("PreviewManager", () => {...@@ -3389,6 +3467,7 @@ describe("PreviewManager", () => {
3389 goBack,3467 goBack,
3390 goForward,3468 goForward,
3391 },3469 },
3470 setIgnoreMenuShortcuts: vi.fn(),
3392 setWindowOpenHandler: vi.fn(),3471 setWindowOpenHandler: vi.fn(),
3393 debugger: {3472 debugger: {
3394 isAttached: () => false,3473 isAttached: () => false,
...@@ -3518,6 +3597,7 @@ describe("PreviewManager", () => {...@@ -3518,6 +3597,7 @@ describe("PreviewManager", () => {
3518 },3597 },
3519 send: webviewSend,3598 send: webviewSend,
3520 navigationHistory: { canGoBack: () => false, canGoForward: () => false },3599 navigationHistory: { canGoBack: () => false, canGoForward: () => false },
3600 setIgnoreMenuShortcuts: vi.fn(),
3521 setWindowOpenHandler: vi.fn(),3601 setWindowOpenHandler: vi.fn(),
3522 debugger: {3602 debugger: {
3523 isAttached: () => false,3603 isAttached: () => false,
...@@ -3618,6 +3698,7 @@ describe("PreviewManager", () => {...@@ -3618,6 +3698,7 @@ describe("PreviewManager", () => {
3618 },3698 },
3619 send: webviewSend,3699 send: webviewSend,
3620 navigationHistory: { canGoBack: () => false, canGoForward: () => false },3700 navigationHistory: { canGoBack: () => false, canGoForward: () => false },
3701 setIgnoreMenuShortcuts: vi.fn(),
3621 setWindowOpenHandler: vi.fn(),3702 setWindowOpenHandler: vi.fn(),
3622 debugger: {3703 debugger: {
3623 isAttached: () => false,3704 isAttached: () => false,
...@@ -3773,6 +3854,7 @@ describe("PreviewManager", () => {...@@ -3773,6 +3854,7 @@ describe("PreviewManager", () => {
3773 },3854 },
3774 send: webviewSend,3855 send: webviewSend,
3775 navigationHistory: { canGoBack: () => false, canGoForward: () => false },3856 navigationHistory: { canGoBack: () => false, canGoForward: () => false },
3857 setIgnoreMenuShortcuts: vi.fn(),
3776 setWindowOpenHandler: vi.fn(),3858 setWindowOpenHandler: vi.fn(),
3777 debugger: {3859 debugger: {
3778 isAttached: () => false,3860 isAttached: () => false,
...@@ -3837,6 +3919,7 @@ describe("PreviewManager", () => {...@@ -3837,6 +3919,7 @@ describe("PreviewManager", () => {
3837 ipc: { on: vi.fn(), off: vi.fn() },3919 ipc: { on: vi.fn(), off: vi.fn() },
3838 send: webviewSend,3920 send: webviewSend,
3839 navigationHistory: { canGoBack: () => false, canGoForward: () => false },3921 navigationHistory: { canGoBack: () => false, canGoForward: () => false },
3922 setIgnoreMenuShortcuts: vi.fn(),
3840 setWindowOpenHandler: vi.fn(),3923 setWindowOpenHandler: vi.fn(),
3841 debugger: {3924 debugger: {
3842 isAttached: () => false,3925 isAttached: () => false,
apps/desktop/src/preview/Manager.ts+4-47
...@@ -465,22 +465,6 @@ interface ExpectedAgentInput {...@@ -465,22 +465,6 @@ interface ExpectedAgentInput {
465 readonly expiresAt: number;465 readonly expiresAt: number;
466}466}
467467
468const APP_FORWARDED_SHORTCUTS: ReadonlyArray<{
469 key: string;
470 meta: boolean;
471 shift: boolean;
472 control: boolean;
473}> = Object.freeze([
474 // mod+shift+J → preview.toggle
475 { key: "j", meta: true, shift: true, control: false },
476 // mod+K → command palette
477 { key: "k", meta: true, shift: false, control: false },
478 // mod+, → settings (macOS convention)
479 { key: ",", meta: true, shift: false, control: false },
480 // mod+W → close tab/panel
481 { key: "w", meta: true, shift: false, control: false },
482]);
483
484/**468/**
485 * Protocols a preview page may open in a real popup window.469 * Protocols a preview page may open in a real popup window.
486 *470 *
...@@ -1535,16 +1519,6 @@ const makeNativeOperations = Effect.fn("PreviewManager.makeOperations")(function...@@ -1535,16 +1519,6 @@ const makeNativeOperations = Effect.fn("PreviewManager.makeOperations")(function
1535 }1519 }
1536 });1520 });
15371521
1538 const isAppShortcut = (input: Electron.Input): boolean =>
1539 input.type === "keyDown" &&
1540 APP_FORWARDED_SHORTCUTS.some(
1541 (shortcut) =>
1542 shortcut.key.toLowerCase() === input.key.toLowerCase() &&
1543 shortcut.meta === input.meta &&
1544 shortcut.shift === input.shift &&
1545 shortcut.control === input.control,
1546 );
1547
1548 const computeNavStatus = (wc: Electron.WebContents): PreviewNavStatus => {1522 const computeNavStatus = (wc: Electron.WebContents): PreviewNavStatus => {
1549 const url = wc.getURL();1523 const url = wc.getURL();
1550 const title = wc.getTitle();1524 const title = wc.getTitle();
...@@ -1819,30 +1793,11 @@ const makeNativeOperations = Effect.fn("PreviewManager.makeOperations")(function...@@ -1819,30 +1793,11 @@ const makeNativeOperations = Effect.fn("PreviewManager.makeOperations")(function
1819 }).pipe(Effect.ignore),1793 }).pipe(Effect.ignore),
1820 );1794 );
1821 };1795 };
1822 const forwardShortcut = Effect.fn("PreviewManager.forwardShortcut")(function* (
1823 event: Electron.Event,
1824 input: Electron.Input,
1825 ) {
1826 const mainWindow = yield* Ref.get(mainWindowRef);
1827 if (!isAppShortcut(input) || Option.isNone(mainWindow) || mainWindow.value.isDestroyed()) {
1828 return;
1829 }
1830 event.preventDefault();
1831 mainWindow.value.webContents.sendInputEvent({
1832 type: "keyDown",
1833 keyCode: input.key,
1834 modifiers: [
1835 ...(input.meta ? (["meta"] as const) : []),
1836 ...(input.shift ? (["shift"] as const) : []),
1837 ...(input.control ? (["control"] as const) : []),
1838 ...(input.alt ? (["alt"] as const) : []),
1839 ],
1840 });
1841 });
1842 // A popup opens with Electron's default handler, so the page inside it could1796 // A popup opens with Electron's default handler, so the page inside it could
1843 // otherwise spawn native windows without limit. Nothing in an OAuth flow1797 // otherwise spawn native windows without limit. Nothing in an OAuth flow
1844 // opens a second popup, so the chain stops at the first one.1798 // opens a second popup, so the chain stops at the first one.
1845 const windowCreated = (window: Electron.BrowserWindow): void => {1799 const windowCreated = (window: Electron.BrowserWindow): void => {
1800 window.webContents.setIgnoreMenuShortcuts(true);
1846 window.webContents.setWindowOpenHandler(() => ({ action: "deny" }));1801 window.webContents.setWindowOpenHandler(() => ({ action: "deny" }));
1847 };1802 };
1848 const beforeInput = (event: Electron.Event, input: Electron.Input): void => {1803 const beforeInput = (event: Electron.Event, input: Electron.Input): void => {
...@@ -1855,7 +1810,6 @@ const makeNativeOperations = Effect.fn("PreviewManager.makeOperations")(function...@@ -1855,7 +1810,6 @@ const makeNativeOperations = Effect.fn("PreviewManager.makeOperations")(function
1855 );1810 );
1856 return;1811 return;
1857 }1812 }
1858 runFork(forwardShortcut(event, input));
1859 };1813 };
1860 yield* Scope.addFinalizer(1814 yield* Scope.addFinalizer(
1861 scope,1815 scope,
...@@ -1878,6 +1832,9 @@ const makeNativeOperations = Effect.fn("PreviewManager.makeOperations")(function...@@ -1878,6 +1832,9 @@ const makeNativeOperations = Effect.fn("PreviewManager.makeOperations")(function
1878 );1832 );
1879 const install = Effect.fn("PreviewManager.installWebContentsListeners")(function* () {1833 const install = Effect.fn("PreviewManager.installWebContentsListeners")(function* () {
1880 yield* attempt({ operation: "attachListeners", tabId, webContentsId: wc.id }, () => {1834 yield* attempt({ operation: "attachListeners", tabId, webContentsId: wc.id }, () => {
1835 // Preview input belongs to the page, including keys injected through CDP.
1836 // Never let it invoke the host application's menu accelerators.
1837 wc.setIgnoreMenuShortcuts(true);
1881 wc.on("did-start-navigation", navigationStarted);1838 wc.on("did-start-navigation", navigationStarted);
1882 wc.on("did-navigate", syncNavigation);1839 wc.on("did-navigate", syncNavigation);
1883 wc.on("did-navigate-in-page", syncInPageNavigation);1840 wc.on("did-navigate-in-page", syncInPageNavigation);