author | Bob Silverberg <bsilverberg@mozilla.com> |
Fri, 01 Dec 2017 09:03:44 -0500 | |
changeset 394952 | 4a160faf5ac5f9b3561e945344e8db501b74ad45 |
parent 394951 | 0cb270dda57624ae29346c6da60292280589f728 |
child 394953 | 151826976a7d1cc0773017bdbd1eaa8554fc247e |
push id | 97987 |
push user | nerli@mozilla.com |
push date | Tue, 05 Dec 2017 13:52:50 +0000 |
treeherder | mozilla-inbound@8842dba7396b [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | mixedpuppy |
bugs | 1422211 |
milestone | 59.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/browser/components/extensions/ext-tabs.js +++ b/browser/components/extensions/ext-tabs.js @@ -612,16 +612,22 @@ this.tabs = class extends ExtensionAPI { let lastInsertion = new Map(); let tabs = tabIds.map(tabId => tabTracker.getTab(tabId)); for (let nativeTab of tabs) { // If the window is not specified, use the window from the tab. let window = destinationWindow || nativeTab.ownerGlobal; let gBrowser = window.gBrowser; + // If we are not moving the tab to a different window, and the window + // only has one tab, do nothing. + if (nativeTab.ownerGlobal == window && gBrowser.tabs.length === 1) { + continue; + } + let insertionPoint = indexMap.get(window) || moveProperties.index; // If the index is -1 it should go to the end of the tabs. if (insertionPoint == -1) { insertionPoint = gBrowser.tabs.length; } // We can only move pinned tabs to a point within, or just after, // the current set of pinned tabs. Unpinned tabs, likewise, can only