aboutsummaryrefslogtreecommitdiff
path: root/src/background/tabs.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/background/tabs.js')
-rw-r--r--src/background/tabs.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/background/tabs.js b/src/background/tabs.js
index 020c826..38b2ed9 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(() => {
+ let newPinned = pinned;
+ if (newPinned !== true && newPinned !== false) {
+ newPinned = !current.pinned;
+ }
+ return browser.tabs.update(current.id, { pinned: newPinned });
+ });
+};
+
export {
closeTab, reopenTab, selectAt, selectByKeyword, getCompletions,
- selectPrevTab, selectNextTab, selectFirstTab, selectLastTab, reload
+ selectPrevTab, selectNextTab, selectFirstTab, selectLastTab, reload,
+ updateTabPinned
};