From a26d8a8a1bed48a77e062914c120a23ace7bb8cf Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 24 Feb 2019 20:54:35 +0900 Subject: Capitalize background scripts --- src/background/infrastructures/ConsoleClient.js | 37 +++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/background/infrastructures/ConsoleClient.js (limited to 'src/background/infrastructures/ConsoleClient.js') diff --git a/src/background/infrastructures/ConsoleClient.js b/src/background/infrastructures/ConsoleClient.js new file mode 100644 index 0000000..f691515 --- /dev/null +++ b/src/background/infrastructures/ConsoleClient.js @@ -0,0 +1,37 @@ +import messages from '../../shared/messages'; + +export default class ConsoleClient { + showCommand(tabId, command) { + return browser.tabs.sendMessage(tabId, { + type: messages.CONSOLE_SHOW_COMMAND, + command, + }); + } + + showFind(tabId) { + return browser.tabs.sendMessage(tabId, { + type: messages.CONSOLE_SHOW_FIND + }); + } + + showInfo(tabId, message) { + return browser.tabs.sendMessage(tabId, { + type: messages.CONSOLE_SHOW_INFO, + text: message, + }); + } + + showError(tabId, message) { + return browser.tabs.sendMessage(tabId, { + type: messages.CONSOLE_SHOW_ERROR, + text: message, + }); + } + + hide(tabId) { + return browser.tabs.sendMessage(tabId, { + type: messages.CONSOLE_HIDE, + }); + } +} + -- cgit v1.2.3