Improve theme and navigation IPC between pages

Enhanced inter-process communication for theme updates and navigation between home, settings, and main browser pages. Theme changes in settings now propagate to home via Electron IPC and postMessage fallback. Navigation requests from home and other webviews are handled more robustly, supporting both Electron IPC and postMessage. Also refactored tab creation and improved event handling for better reliability.
This commit is contained in:
2025-07-31 22:40:37 +12:00
parent aba6145bea
commit e8dc253f03
6 changed files with 109 additions and 47 deletions
+6 -3
View File
@@ -478,10 +478,13 @@ class BrowserCustomizer {
applyThemeToPages() {
// This will be called to apply theme to home.html and other pages
// We'll store the theme and let other pages load it
this.saveTheme();
// If we have access to other windows/frames, apply there too
// Send theme update to host (for settings webview)
if (window.electronAPI && typeof window.electronAPI.sendToHost === 'function') {
window.electronAPI.sendToHost('theme-update', this.currentTheme);
}
// Fallback: send via postMessage (for iframe embedding)
try {
if (window.parent && window.parent !== window) {
window.parent.postMessage({