Merge pull request #3453 from Rummskartoffel/patch-1

Remove outdated comment
This commit is contained in:
Oliver Blanthorn 2021-03-10 16:10:26 +00:00 committed by GitHub
commit a7ddfd6ae9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2217,9 +2217,6 @@ export async function tabnext_gt(index?: number) {
*/ */
//#background //#background
export async function tabprev(increment = 1) { export async function tabprev(increment = 1) {
// Proper way:
// return tabIndexSetActive((await activeTab()).index - increment + 1)
// Kludge until https://bugzilla.mozilla.org/show_bug.cgi?id=1504775 is fixed:
return browser.tabs.query({ currentWindow: true, hidden: false }).then(tabs => { return browser.tabs.query({ currentWindow: true, hidden: false }).then(tabs => {
tabs.sort((t1, t2) => t1.index - t2.index) tabs.sort((t1, t2) => t1.index - t2.index)
const prevTab = (tabs.findIndex(t => t.active) - increment + tabs.length) % tabs.length const prevTab = (tabs.findIndex(t => t.active) - increment + tabs.length) % tabs.length