|
|
@ -1,16 +1,16 @@ |
|
|
|
import * as tabs from './tabs'; |
|
|
|
import * as tabs from './tabs'; |
|
|
|
|
|
|
|
|
|
|
|
const KEY_MAP = { |
|
|
|
const KEY_MAP = { |
|
|
|
'tabs.prev': 104, |
|
|
|
'tabs.prev': KeyboardEvent.DOM_VK_H, |
|
|
|
'tabs.next': 108, |
|
|
|
'tabs.next': KeyboardEvent.DOM_VK_L, |
|
|
|
'scroll.up': 107, |
|
|
|
'scroll.up': KeyboardEvent.DOM_VK_K, |
|
|
|
'scroll.down': 106 |
|
|
|
'scroll.down': KeyboardEvent.DOM_VK_J |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
browser.runtime.onMessage.addListener((request, sender, sendResponse) => { |
|
|
|
browser.runtime.onMessage.addListener((request, sender, sendResponse) => { |
|
|
|
let response = null; |
|
|
|
let response = null; |
|
|
|
|
|
|
|
|
|
|
|
switch (request.key) { |
|
|
|
switch (request.code) { |
|
|
|
case KEY_MAP['tabs.prev']: |
|
|
|
case KEY_MAP['tabs.prev']: |
|
|
|
tabs.selectPrevTab(sender.tab.index); |
|
|
|
tabs.selectPrevTab(sender.tab.index); |
|
|
|
break; |
|
|
|
break; |
|
|
|