diff --git a/manage/manage.js b/manage/manage.js index 66620799..c74e9e2d 100644 --- a/manage/manage.js +++ b/manage/manage.js @@ -409,7 +409,13 @@ Object.assign(handleEvent, { if (chrome.windows && openWindow) { chrome.windows.create(Object.assign(prefs.get('windowPosition'), {url})); } else { - openURL({url, active: openForegroundTab}); + getOwnTab().then(({index}) => { + openURL({ + url, + index: index + 1, + active: openForegroundTab + }); + }); } } else { rememberScrollPosition(); @@ -458,7 +464,17 @@ Object.assign(handleEvent, { }, external(event) { - openURL({url: event.target.closest('a').href}); + if (event.shiftKey && !event.altKey && !event.ctrlKey && !event.metaKey) { + // Shift-click = the built-in 'open in a new window' action + return; + } + getOwnTab().then(({index}) => { + openURL({ + url: event.target.closest('a').href, + index: index + 1, + active: !event.ctrlKey || event.shiftKey, + }); + }); event.preventDefault(); },