diff options
Diffstat (limited to 'src/background/tabs.js')
-rw-r--r-- | src/background/tabs.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/background/tabs.js b/src/background/tabs.js index 020c826..23b3b7b 100644 --- a/src/background/tabs.js +++ b/src/background/tabs.js @@ -100,7 +100,19 @@ const reload = (current, cache) => { ); }; +const updateTabPinned = (current, pinned) => { + return browser.tabs.query({ currentWindow: true, active: true }) + .then(() => { + return browser.tabs.update(current.id, { pinned: pinned }); + }); +}; + +const toggleTabPinned = (current) => { + updateTabPinned(current, !current.pinned); +}; + export { closeTab, reopenTab, selectAt, selectByKeyword, getCompletions, - selectPrevTab, selectNextTab, selectFirstTab, selectLastTab, reload + selectPrevTab, selectNextTab, selectFirstTab, selectLastTab, reload, + updateTabPinned, toggleTabPinned }; |