Improve webview tab activation and styling

Ensure the webviews container is visible when converting a home tab to a webview, and activate the converted tab in the UI. Also, update webview CSS to set width and height to 100% for better layout consistency.
This commit is contained in:
2025-07-31 21:41:21 +12:00
parent 0f93274d84
commit b96b61e6da
3 changed files with 11 additions and 1 deletions
+6
View File
@@ -276,6 +276,9 @@ function convertHomeTabToWebview(tabId, inputUrl, resolvedUrl) {
const tab = tabs.find(t => t.id === tabId);
if (!tab) return;
// Ensure webviews container is visible
const webviewsEl = document.getElementById('webviews');
if (webviewsEl) webviewsEl.classList.remove('hidden');
// Create a new webview for this tab
const webview = document.createElement('webview');
webview.id = `tab-${tabId}`;
@@ -339,6 +342,9 @@ function convertHomeTabToWebview(tabId, inputUrl, resolvedUrl) {
webview.classList.add('active');
updateNavButtons();
// Activate converted webview tab and update UI
setActiveTab(tabId);
renderTabs();
}
function handleNavigation(tabId, newUrl) {
+2
View File
@@ -136,6 +136,8 @@ html, body {
#webviews webview {
flex: 1;
width: 100%;
height: 100%;
border: none;
display: none;
}
+3 -1
View File
@@ -1,7 +1,9 @@
[
"https://www.youtube.com/",
"https://github.com/",
"file:///X:/Projects/Code/NebulaBrowser/renderer/index.html",
"file:///X:/Projects/Code/NebulaBrowser/renderer/index.html",
"https://www.youtube.com/",
"file:///X:/Projects/Code/NebulaBrowser/renderer/index.html",
"https://youtube.com/",
"file:///X:/Projects/Code/NebulaBrowser/renderer/index.html",
"https://youtube.com/",