experiments in a post-browser web
10
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(cmd): prevent Cmd+L conflict with page host, guard command re-init

+23 -1
+14
backend/electron/main.ts
··· 351 351 352 352 // Handle local shortcuts (with window ID for mode-conditional shortcuts) 353 353 window.webContents.on('before-input-event', (event, input) => { 354 + // Page host windows (canvas) have their own Cmd+L handler for the floating navbar 355 + // (registered in openWindow). Skip local shortcut handling for Cmd+L on those windows 356 + // so the page host's before-input-event handler can handle it instead. 357 + if (input.type === 'keyDown' && input.key === 'l') { 358 + const mod = process.platform === 'darwin' ? input.meta : input.control; 359 + if (mod && !input.alt && !input.shift) { 360 + const winInfo = getWindowInfo(windowId); 361 + const addr = winInfo?.params?.address as string | undefined; 362 + if (addr && (addr.startsWith('http://') || addr.startsWith('https://') || addr.startsWith('file:///'))) { 363 + return; // Let the page host's own handler deal with Cmd+L 364 + } 365 + } 366 + } 367 + 354 368 if (handleLocalShortcut(input, windowId)) { 355 369 event.preventDefault(); 356 370 }
+2 -1
extensions/cmd/background.js
··· 412 412 }); 413 413 414 414 // URL mode shortcut (Cmd+L) — opens panel in URL-only navigation mode 415 - // Page host windows intercept Cmd+L via before-input-event for their navbar, 415 + // Page host windows have their own Cmd+L handler for the floating navbar. 416 + // main.ts skips local shortcut dispatch for Cmd+L on page host windows, 416 417 // so this only fires from non-page windows. 417 418 api.shortcuts.register(URL_MODE_SHORTCUT, () => { 418 419 api.publish('cmd:url-mode', {}, api.scopes.GLOBAL);
+7
extensions/cmd/commands.js
··· 61 61 /** 62 62 * Initializes all command sources and registers them 63 63 */ 64 + let _sourcesInitialized = false; 65 + 64 66 async function initializeCommandSources() { 67 + if (_sourcesInitialized) { 68 + debug && console.log('[cmd:commands] sources already initialized, skipping'); 69 + return; 70 + } 71 + _sourcesInitialized = true; 65 72 debug && console.log('[cmd:commands] initializeCommandSources'); 66 73 67 74 // Load commands from the commands module