tabs should open next to the manager tab

closes #427
This commit is contained in:
tophf 2018-07-11 19:02:49 +03:00
parent 17d81099b1
commit b5b0bcaf19

View File

@ -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();
},