diff --git a/package-lock.json b/package-lock.json index db71c9d..37a7f38 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "ISC", "devDependencies": { - "electron": "^37.2.3", + "electron": "^37.2.4", "electron-builder": "^23.0.0" } }, @@ -1386,9 +1386,9 @@ } }, "node_modules/electron": { - "version": "37.2.3", - "resolved": "https://registry.npmjs.org/electron/-/electron-37.2.3.tgz", - "integrity": "sha512-JRKKn8cRDXDfkC+oWISbYs+c+L6RA776JM0NiB9bn2yV8H/LnBUlVPzKKfsXgrUIokN4YcbCw694vfAdEJwtGw==", + "version": "37.2.4", + "resolved": "https://registry.npmjs.org/electron/-/electron-37.2.4.tgz", + "integrity": "sha512-F1WDDvY60TpFwGyW+evNB5q0Em8PamcDTVIKB2NaiaKEbNC2Fabn8Wyxy5g+Anirr1K40eKGjfSJhWEUbI1TOw==", "dev": true, "hasInstallScript": true, "license": "MIT", diff --git a/package.json b/package.json index 2f0c995..bdd7fb6 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "license": "ISC", "description": "", "devDependencies": { - "electron": "^37.2.3", + "electron": "^37.2.4", "electron-builder": "^23.0.0" }, "build": { diff --git a/renderer/script.js b/renderer/script.js index 9de41e7..7a7e8a3 100644 --- a/renderer/script.js +++ b/renderer/script.js @@ -36,97 +36,18 @@ const menuPopup = document.getElementById('menu-popup'); const contextMenu = document.getElementById('context-menu'); const menuItems = contextMenu ? contextMenu.querySelectorAll('li') : []; -let siteHistoryDropdown = null; - -function initializeSiteHistoryDropdown() { - // Create site history dropdown - siteHistoryDropdown = document.createElement('div'); - siteHistoryDropdown.id = 'site-history-dropdown'; - siteHistoryDropdown.style.cssText = ` - position: absolute; - top: 100%; - left: 0; - right: 0; - background: white; - border: 1px solid #ccc; - border-top: none; - max-height: 200px; - overflow-y: auto; - z-index: 1000; - display: none; - `; - - if (urlBox && urlBox.parentElement) { - urlBox.parentElement.style.position = 'relative'; - urlBox.parentElement.appendChild(siteHistoryDropdown); - } -} - -function showSiteHistory() { - if (!siteHistoryDropdown) return; - - const history = getSiteHistory(); - if (history.length === 0) { - siteHistoryDropdown.style.display = 'none'; - return; - } - - siteHistoryDropdown.innerHTML = ''; - history.slice(0, 10).forEach(url => { - const item = document.createElement('div'); - item.style.cssText = ` - padding: 8px 12px; - cursor: pointer; - border-bottom: 1px solid #eee; - font-size: 14px; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - `; - item.textContent = url; - item.addEventListener('mouseenter', () => item.style.backgroundColor = '#f0f0f0'); - item.addEventListener('mouseleave', () => item.style.backgroundColor = 'white'); - item.addEventListener('click', () => { - urlBox.value = url; - navigate(); - hideSiteHistory(); - }); - siteHistoryDropdown.appendChild(item); - }); - - siteHistoryDropdown.style.display = 'block'; -} - -function hideSiteHistory() { - if (siteHistoryDropdown) { - siteHistoryDropdown.style.display = 'none'; - } -} - // Select all text on focus and prevent mouseup from deselecting urlBox.addEventListener('focus', () => { urlBox.select(); - showSiteHistory(); }); urlBox.addEventListener('mouseup', e => e.preventDefault()); // Add Enter key navigation urlBox.addEventListener('keydown', (e) => { if (e.key === 'Enter') { navigate(); - hideSiteHistory(); - } else if (e.key === 'Escape') { - hideSiteHistory(); } }); -// Hide history when clicking outside -document.addEventListener('click', (e) => { - if (!urlBox.contains(e.target) && (!siteHistoryDropdown || !siteHistoryDropdown.contains(e.target))) { - hideSiteHistory(); - } -}); - - let tabs = []; let activeTabId = null; const allowedInternalPages = ['settings', 'home']; @@ -466,9 +387,6 @@ menuBtn.addEventListener('click', () => { }); window.addEventListener('DOMContentLoaded', () => { - // Initialize site history dropdown after DOM is ready - initializeSiteHistoryDropdown(); - // Add some debug info console.log('[DEBUG] Site history initialized, current entries:', getSiteHistory().length); diff --git a/search-history.json b/search-history.json index 31839b5..c44dc44 100644 --- a/search-history.json +++ b/search-history.json @@ -1,3 +1,3 @@ [ - "Awatapu College" + ] \ No newline at end of file diff --git a/site-history.json b/site-history.json index a448d53..c44dc44 100644 --- a/site-history.json +++ b/site-history.json @@ -1,18 +1,3 @@ [ - "file:///X:/Projects/Code/NebulaBrowser/renderer/index.html", - "https://www.youtube.com/", - "https://www.youtube.com/watch?v=6JWxHy0C_pI", - "https://www.youtube.com/results?search_query=4k+video", - "https://www.youtube.com/watch?v=rUOHPDmKTXA", - "https://youtube.com/", - "file:///X:/Projects/Code/NebulaBrowser/renderer/index.html", - "https://www.google.com/search?q=Awatapu%20College", - "https://andrewzambazos.com/", - "file:///X:/Projects/Code/NebulaBrowser/renderer/index.html", - "file:///X:/Projects/Code/NebulaBrowser/renderer/index.html", - "https://youtube.com/", - "file:///X:/Projects/Code/NebulaBrowser/renderer/index.html", - "https://www.google.com/", - "https://youtube.com/", - "file:///X:/Projects/Code/NebulaBrowser/renderer/index.html" + ] \ No newline at end of file