From d41c7476a6ae10cb906f826d97cef86e9d237151 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Tue, 8 May 2018 20:54:28 +0900 Subject: [PATCH] Add command.show.addbookmark operation --- src/background/components/operation.js | 5 +++++ src/shared/operations.js | 1 + src/shared/settings/default.js | 1 + 3 files changed, 7 insertions(+) diff --git a/src/background/components/operation.js b/src/background/components/operation.js index 9a0b4e1..58edb8c 100644 --- a/src/background/components/operation.js +++ b/src/background/components/operation.js @@ -90,6 +90,11 @@ export default class BackgroundComponent { return this.sendConsoleShowCommand(tab, 'winopen '); case operations.COMMAND_SHOW_BUFFER: return this.sendConsoleShowCommand(tab, 'buffer '); + case operations.COMMAND_SHOW_ADDBOOKMARK: + if (operation.alter) { + return this.sendConsoleShowCommand(tab, 'addbookmark ' + tab.title); + } + return this.sendConsoleShowCommand(tab, 'addbookmark '); case operations.FIND_START: return browser.tabs.sendMessage(tab.id, { type: messages.CONSOLE_SHOW_FIND diff --git a/src/shared/operations.js b/src/shared/operations.js index e8cc8cf..b022537 100644 --- a/src/shared/operations.js +++ b/src/shared/operations.js @@ -13,6 +13,7 @@ export default { COMMAND_SHOW_TABOPEN: 'command.show.tabopen', COMMAND_SHOW_WINOPEN: 'command.show.winopen', COMMAND_SHOW_BUFFER: 'command.show.buffer', + COMMAND_SHOW_ADDBOOKMARK: 'command.show.addbookmark', // Scrolls SCROLL_VERTICALLY: 'scroll.vertically', diff --git a/src/shared/settings/default.js b/src/shared/settings/default.js index 9e1c202..a435099 100644 --- a/src/shared/settings/default.js +++ b/src/shared/settings/default.js @@ -11,6 +11,7 @@ export default { "w": { "type": "command.show.winopen", "alter": false }, "W": { "type": "command.show.winopen", "alter": true }, "b": { "type": "command.show.buffer" }, + "a": { "type": "command.show.addbookmark", "alter": true }, "k": { "type": "scroll.vertically", "count": -1 }, "j": { "type": "scroll.vertically", "count": 1 }, "h": { "type": "scroll.horizonally", "count": -1 },