experiments in a post-browser web
10
fork

Configure Feed

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

fix(page): filter Cmd+L/R/[/] pubsub by windowId so only active page window responds

+14 -4
+14 -4
app/page/page.js
··· 21 21 22 22 const DEBUG = true; 23 23 24 + // Cache our window ID for filtering GLOBAL pubsub messages 25 + let myWindowId = null; 26 + api.window.getWindowId().then(id => { myWindowId = id; }); 27 + 24 28 // --- OAuth URL detection (Level 2) --- 25 29 // Patterns that indicate an OAuth/authentication flow in progress. 26 30 // When detected, navbar auto-show on hover is suppressed to avoid interrupting the flow. ··· 752 756 }); 753 757 754 758 // Cmd+L: show navbar with URL focus 755 - api.subscribe('page:show-navbar', () => show({ focusUrl: true, source: 'shortcut' }), api.scopes.GLOBAL); 759 + api.subscribe('page:show-navbar', (msg) => { 760 + if (msg.windowId != null && msg.windowId !== myWindowId) return; 761 + show({ focusUrl: true, source: 'shortcut' }); 762 + }, api.scopes.GLOBAL); 756 763 757 764 // Cmd+R: reload the webview 758 - api.subscribe('page:reload', () => { 765 + api.subscribe('page:reload', (msg) => { 766 + if (msg.windowId != null && msg.windowId !== myWindowId) return; 759 767 DEBUG && console.log('[page] Cmd+R: reloading webview'); 760 768 webview.reload(); 761 769 }, api.scopes.GLOBAL); 762 770 763 771 // Cmd+[ / Cmd+Left: go back 764 - api.subscribe('page:go-back', () => { 772 + api.subscribe('page:go-back', (msg) => { 773 + if (msg.windowId != null && msg.windowId !== myWindowId) return; 765 774 if (webview.canGoBack()) { 766 775 DEBUG && console.log('[page] Cmd+[: going back'); 767 776 webview.goBack(); ··· 770 779 }, api.scopes.GLOBAL); 771 780 772 781 // Cmd+] / Cmd+Right: go forward 773 - api.subscribe('page:go-forward', () => { 782 + api.subscribe('page:go-forward', (msg) => { 783 + if (msg.windowId != null && msg.windowId !== myWindowId) return; 774 784 if (webview.canGoForward()) { 775 785 DEBUG && console.log('[page] Cmd+]: going forward'); 776 786 webview.goForward();