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:
@@ -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) {
|
||||
|
||||
@@ -136,6 +136,8 @@ html, body {
|
||||
|
||||
#webviews webview {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: none;
|
||||
display: none;
|
||||
}
|
||||
|
||||
+3
-1
@@ -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/",
|
||||
|
||||
Reference in New Issue
Block a user