|
|
@ -1,3 +1,13 @@ |
|
|
|
|
|
|
|
let prevSelTab = 1; |
|
|
|
|
|
|
|
let currSelTab = 1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
browser.tabs.onActivated.addListener((activeInfo) => { |
|
|
|
|
|
|
|
return browser.tabs.query({ currentWindow: true }).then(() => { |
|
|
|
|
|
|
|
prevSelTab = currSelTab; |
|
|
|
|
|
|
|
currSelTab = activeInfo.tabId; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
const closeTab = (id) => { |
|
|
|
const closeTab = (id) => { |
|
|
|
return browser.tabs.remove(id); |
|
|
|
return browser.tabs.remove(id); |
|
|
|
}; |
|
|
|
}; |
|
|
@ -93,6 +103,10 @@ const selectLastTab = () => { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const selectPrevSelTab = () => { |
|
|
|
|
|
|
|
return browser.tabs.update(prevSelTab, { active: true }); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const reload = (current, cache) => { |
|
|
|
const reload = (current, cache) => { |
|
|
|
return browser.tabs.reload( |
|
|
|
return browser.tabs.reload( |
|
|
|
current.id, |
|
|
|
current.id, |
|
|
@ -117,6 +131,6 @@ const duplicate = (id) => { |
|
|
|
|
|
|
|
|
|
|
|
export { |
|
|
|
export { |
|
|
|
closeTab, reopenTab, selectAt, selectByKeyword, getCompletions, |
|
|
|
closeTab, reopenTab, selectAt, selectByKeyword, getCompletions, |
|
|
|
selectPrevTab, selectNextTab, selectFirstTab, selectLastTab, reload, |
|
|
|
selectPrevTab, selectNextTab, selectFirstTab, selectLastTab, selectPrevSelTab, |
|
|
|
updateTabPinned, toggleTabPinned, duplicate |
|
|
|
reload, updateTabPinned, toggleTabPinned, duplicate |
|
|
|
}; |
|
|
|
}; |
|
|
|