Remove site history dropdown and update Electron
Eliminated the custom site history dropdown UI and its related event handlers from script.js. Updated Electron to version 37.2.4 in package.json and package-lock.json. Cleared entries from search-history.json and site-history.json.
This commit is contained in:
Generated
+4
-4
@@ -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",
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
"license": "ISC",
|
||||
"description": "",
|
||||
"devDependencies": {
|
||||
"electron": "^37.2.3",
|
||||
"electron": "^37.2.4",
|
||||
"electron-builder": "^23.0.0"
|
||||
},
|
||||
"build": {
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
[
|
||||
"Awatapu College"
|
||||
|
||||
]
|
||||
+1
-16
@@ -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"
|
||||
|
||||
]
|
||||
Reference in New Issue
Block a user