diff options
Diffstat (limited to 'src/background')
-rw-r--r-- | src/background/index.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/background/index.js b/src/background/index.js index d4e0098..793f330 100644 --- a/src/background/index.js +++ b/src/background/index.js @@ -2,10 +2,14 @@ import * as tabs from './tabs'; const KEY_MAP = { 'tabs.prev': 104, - 'tabs.next': 108 + 'tabs.next': 108, + 'scroll.up': 107, + 'scroll.down': 106 }; browser.runtime.onMessage.addListener((request, sender, sendResponse) => { + let response = null; + switch (request.key) { case KEY_MAP['tabs.prev']: tabs.selectPrevTab(sender.tab.index); @@ -13,6 +17,12 @@ browser.runtime.onMessage.addListener((request, sender, sendResponse) => { case KEY_MAP['tabs.next']: tabs.selectNextTab(sender.tab.index); break; + case KEY_MAP['scroll.up']: + response = 'scroll.up' + break; + case KEY_MAP['scroll.down']: + response = 'scroll.down' + break; } - sendResponse(); + sendResponse(response); }); |