aboutsummaryrefslogtreecommitdiff
path: root/src/background
diff options
context:
space:
mode:
Diffstat (limited to 'src/background')
-rw-r--r--src/background/index.js6
-rw-r--r--src/background/key-queue.js2
2 files changed, 7 insertions, 1 deletions
diff --git a/src/background/index.js b/src/background/index.js
index e8882c5..8544c0f 100644
--- a/src/background/index.js
+++ b/src/background/index.js
@@ -36,7 +36,11 @@ const doBackgroundAction = (sender, action) => {
}
const normalizeUrl = (string) => {
- return 'http://' + string;
+ try {
+ return new URL(string).href
+ } catch (e) {
+ return 'http://' + string;
+ }
}
const cmdEnterHandle = (request, sender) => {
diff --git a/src/background/key-queue.js b/src/background/key-queue.js
index acbb6e0..3f25791 100644
--- a/src/background/key-queue.js
+++ b/src/background/key-queue.js
@@ -3,6 +3,8 @@ import * as actions from '../shared/actions';
const DEFAULT_KEYMAP = [
{ keys: [{ code: KeyboardEvent.DOM_VK_SEMICOLON, shift: true }], action: [ actions.CMD_OPEN ]},
+ { keys: [{ code: KeyboardEvent.DOM_VK_O }], action: [ actions.CMD_TABS_OPEN, false ]},
+ { keys: [{ code: KeyboardEvent.DOM_VK_O, shift: true }], action: [ actions.CMD_TABS_OPEN, true ]},
{ keys: [{ code: KeyboardEvent.DOM_VK_K }], action: [ actions.SCROLL_UP, 1 ]},
{ keys: [{ code: KeyboardEvent.DOM_VK_J }], action: [ actions.SCROLL_DOWN, 1 ]},
{ keys: [{ code: KeyboardEvent.DOM_VK_G }, { code: KeyboardEvent.DOM_VK_G }], action: [ actions.SCROLL_TOP ]},