Add BrowserView tab system and overlay menu for desktop mode

Introduces a BrowserView-based tab management system for desktop mode, replacing webview elements for tab content. Adds IPC handlers and state management for creating, activating, destroying, and communicating with BrowserViews. Implements an overlay menu popup window for tab actions and zoom controls. Updates renderer UI to use a dedicated view host container, and refactors tab creation and navigation logic to use BrowserViews. Improves focus styling in CSS and updates preload and IPC messaging to support BrowserView contexts.
This commit is contained in:
2026-01-19 20:57:24 +13:00
parent 03a99b7d46
commit a0e76e623d
9 changed files with 1010 additions and 600 deletions
+18 -2
View File
@@ -10,6 +10,13 @@ try {
fsModule = null;
}
// BrowserView tab id (desktop mode) injected via additionalArguments
let nebulaTabId = null;
try {
const arg = (process?.argv || []).find(a => typeof a === 'string' && a.startsWith('--nebula-tab-id='));
if (arg) nebulaTabId = arg.split('=')[1] || null;
} catch {}
// =============================================================================
// GAMEPAD HANDLER - Steam Deck / SteamOS Support
// =============================================================================
@@ -272,10 +279,19 @@ const electronAPI = {
console.error('IPC send error:', err);
}
},
// Send message to embedding page (webview host)
// Send message to embedding page (webview host) or to BrowserView host
sendToHost: (ch, ...args) => {
try {
return ipcRenderer.sendToHost(ch, ...args);
// If running in BrowserView context, ALWAYS use browserview-host-message
if (nebulaTabId) {
return ipcRenderer.send('browserview-host-message', { tabId: nebulaTabId, channel: ch, args });
}
// Otherwise try ipcRenderer.sendToHost (for webview contexts)
if (typeof ipcRenderer.sendToHost === 'function') {
return ipcRenderer.sendToHost(ch, ...args);
}
// Final fallback
return ipcRenderer.send(ch, ...args);
} catch (err) {
console.error('IPC sendToHost error:', err);
}