From 8a326c7cdbf92a6927d9a688028ff5e49c03d3c0 Mon Sep 17 00:00:00 2001 From: Equa <107852330+EquaTechnologies@users.noreply.github.com> Date: Fri, 13 Dec 2024 21:18:26 +0200 Subject: [PATCH] Update shortcuts.js --- js/shortcuts.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/js/shortcuts.js b/js/shortcuts.js index d968694..a197444 100644 --- a/js/shortcuts.js +++ b/js/shortcuts.js @@ -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(); } -}; \ No newline at end of file +};