Skip to content

Commit

Permalink
fix: scrollable workaround if opener tab is pinned
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudLigny committed Jan 17, 2024
1 parent 3741b1a commit 7957127
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "open-new-tab-after-current-tab",
"version": "0.4.6",
"version": "0.4.7",
"description": "Opens new tab after the active tab, instead of last position.",
"homepage": "https://dev.ligny.org/Open-New-Tab-After-Current-Tab/",
"author": "Arnaud Ligny",
Expand Down
11 changes: 8 additions & 3 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,14 @@ function moveIt(tab, event) {
index: moveToIndex,
}, movedTab => {
// Workaround for the Chrome and Edge scrollable tabstrip issue
chrome.tabs.update(movedTab.openerTabId, {active: true}, () => {
console.log(tab.windowId + ': active moved tab');
chrome.tabs.update(movedTab.id, {active: true});
// only if opener tab is not pinned
chrome.tabs.get(movedTab.openerTabId, async tab => {
if (!tab.pinned) {
chrome.tabs.update(movedTab.openerTabId, {active: true}, () => {
console.log(tab.windowId + ': active moved tab');
chrome.tabs.update(movedTab.id, {active: true});
});
}
});
});
if (currentGroup >= 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Open New Tab After Current Tab",
"version": "0.4.6",
"version": "0.4.7",
"description": "__MSG_extDescription__",
"homepage_url": "https://dev.ligny.org/Open-New-Tab-After-Current-Tab/",
"author": "Arnaud Ligny",
Expand Down

0 comments on commit 7957127

Please sign in to comment.