Fix webview creation and update site history

Refactored createTab to properly set webview attributes (id, src, allowpopups, partition, preload) for correct loading and management. Updated site-history.json with recent search and navigation entries.
This commit is contained in:
2025-07-31 22:45:57 +12:00
parent e8dc253f03
commit 90dfe73632
2 changed files with 34 additions and 22 deletions
+7
View File
@@ -118,6 +118,13 @@ function createTab(inputUrl) {
console.log('[DEBUG] createTab() resolvedUrl =', resolvedUrl); console.log('[DEBUG] createTab() resolvedUrl =', resolvedUrl);
const webview = document.createElement('webview'); const webview = document.createElement('webview');
// give the webview an id and set its source and attributes so it actually loads and can be managed
webview.id = `tab-${id}`;
webview.src = resolvedUrl;
webview.setAttribute('allowpopups', '');
webview.setAttribute('partition', 'persist:default');
webview.setAttribute('preload', '../preload.js');
webview.addEventListener('page-favicon-updated', e => { webview.addEventListener('page-favicon-updated', e => {
if (e.favicons.length > 0) updateTabMetadata(id, 'favicon', e.favicons[0]); if (e.favicons.length > 0) updateTabMetadata(id, 'favicon', e.favicons[0]);
}); });
+5
View File
@@ -1,7 +1,12 @@
[ [
"https://duckduckgo.com/?q=dogs&ia=web",
"https://duckduckgo.com/?q=dogs",
"https://www.bing.com/search?q=dogs",
"https://www.google.com/search?q=cats",
"https://www.youtube.com/", "https://www.youtube.com/",
"https://github.com/", "https://github.com/",
"file:///X:/Projects/Code/NebulaBrowser/renderer/index.html", "file:///X:/Projects/Code/NebulaBrowser/renderer/index.html",
"file:///X:/Projects/Code/NebulaBrowser/renderer/index.html",
"https://youtube.com/", "https://youtube.com/",
"file:///X:/Projects/Code/NebulaBrowser/renderer/index.html", "file:///X:/Projects/Code/NebulaBrowser/renderer/index.html",
"https://youtube.com/", "https://youtube.com/",