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,7 +255,15 @@ const shortcuts = {
}
} else if (action === 'delete') {
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');
});
@ -263,4 +271,4 @@ const shortcuts = {
shortcuts.render();
}
};
};