Skip to content

Commit 723b542

Browse files
committed
Fix keyboard shortcuts in Chrome
1 parent 7008946 commit 723b542

File tree

3 files changed

+22
-21
lines changed

3 files changed

+22
-21
lines changed

background.js

+20-19
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,27 @@ let deques = undefined;
44
let nextTabId = undefined;
55

66
browser.commands.onCommand.addListener(command => {
7-
browser.storage.local.get(OPTION_DISABLE_KEYBOARD_SHORTCUTS, result => {
8-
if (!result[OPTION_DISABLE_KEYBOARD_SHORTCUTS]) {
9-
if (command === "send-tab-to-end-of-tabdeque") {
10-
runOnCurrentTab(
11-
(tab) => {
12-
let tabId = tab.id;
13-
let windowId = tab.windowId;
14-
sendTabToEndOfDeque(windowId, tabId);
15-
}
16-
);
17-
} else if (command === "select-tab-from-end-of-tabdeque") {
18-
runOnCurrentTab(
19-
(tab) => {
20-
let windowId = tab.windowId;
21-
selectTabFromEndOfDeque(windowId);
22-
}
23-
);
7+
browser.storage.local.get(OPTION_DISABLE_KEYBOARD_SHORTCUTS)
8+
.then(result => {
9+
if (!result[OPTION_DISABLE_KEYBOARD_SHORTCUTS]) {
10+
if (command === "send-tab-to-end-of-tabdeque") {
11+
runOnCurrentTab(
12+
(tab) => {
13+
let tabId = tab.id;
14+
let windowId = tab.windowId;
15+
sendTabToEndOfDeque(windowId, tabId);
16+
}
17+
);
18+
} else if (command === "select-tab-from-end-of-tabdeque") {
19+
runOnCurrentTab(
20+
(tab) => {
21+
let windowId = tab.windowId;
22+
selectTabFromEndOfDeque(windowId);
23+
}
24+
);
25+
}
2426
}
25-
}
26-
});
27+
});
2728
});
2829

2930
browser.contextMenus.create(

manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@
4444
"contextMenus",
4545
"storage"
4646
],
47-
"version": "2.1.0"
47+
"version": "2.1.1"
4848
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@
3030
"test": "web-ext lint"
3131
},
3232
"title": "A firefox extension for better tab handling. Inspired by Opera 12.",
33-
"version": "2.1.0"
33+
"version": "2.1.1"
3434
}

0 commit comments

Comments
 (0)