Skip to content

Commit

Permalink
Merge pull request #1055 from ericlathrop/fix-moving-pinned-tabs-to-n…
Browse files Browse the repository at this point in the history
…ew-window

Fix #1053.
  • Loading branch information
groovecoder committed Jan 29, 2018
2 parents d3b22fa + d7a2b43 commit f17ff71
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/js/background/backgroundLogic.js
Expand Up @@ -131,9 +131,13 @@ const backgroundLogic = {
let newWindowObj;
let hiddenDefaultTabToClose;
if (list.length) {
newWindowObj = await browser.windows.create({
tabId: list.shift().id
});
newWindowObj = await browser.windows.create();

// Pin the default tab in the new window so existing pinned tabs can be moved after it.
// From the docs (https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/tabs/move):
// Note that you can't move pinned tabs to a position after any unpinned tabs in a window, or move any unpinned tabs to a position before any pinned tabs.
await browser.tabs.update(newWindowObj.tabs[0].id, { pinned: true });

browser.tabs.move(list.map((tab) => tab.id), {
windowId: newWindowObj.id,
index: -1
Expand Down

0 comments on commit f17ff71

Please sign in to comment.