Update shortcuts.js

This commit is contained in:
Equa 2024-12-13 21:18:26 +02:00 committed by GitHub
parent a872db13a2
commit 8a326c7cdb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -255,6 +255,14 @@ const shortcuts = {
} }
} else if (action === 'delete') { } else if (action === 'delete') {
shortcuts.remove(index); shortcuts.remove(index);
} else if (action === 'open-new-tab') {
const currentShortcuts = Storage.get('shortcuts') || [];
const shortcut = currentShortcuts[index];
// Open the URL of the shortcut in a new tab
if (shortcut && shortcut.url) {
window.open(shortcut.url, '_blank');
}
} }
contextMenu.classList.add('hidden'); contextMenu.classList.add('hidden');