diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2018-07-13 22:36:56 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2018-07-13 22:36:56 +0900 |
commit | 944dea59199fa03f77e0e7c0d3c02acf8ccb458f (patch) | |
tree | 5f44471cdb32376a8c93e6f6eba738180f08c96f /src/background/actions/console.js | |
parent | 77b4e807e2a8b3e7ddb5f042719a34962a31b1c4 (diff) | |
parent | 28bfa3ac8124d3453cd539db26da4f4703e783df (diff) |
Merge remote-tracking branch 'origin/master' into greenkeeper/css-loader-1.0.0
Diffstat (limited to 'src/background/actions/console.js')
-rw-r--r-- | src/background/actions/console.js | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/background/actions/console.js b/src/background/actions/console.js new file mode 100644 index 0000000..d385b2d --- /dev/null +++ b/src/background/actions/console.js @@ -0,0 +1,41 @@ +import messages from 'shared/messages'; + +const error = async(tab, text) => { + await browser.tabs.sendMessage(tab.id, { + type: messages.CONSOLE_SHOW_ERROR, + text, + }); + return { type: '' }; +}; + +const info = async(tab, text) => { + await browser.tabs.sendMessage(tab.id, { + type: messages.CONSOLE_SHOW_INFO, + text, + }); + return { type: '' }; +}; + +const showCommand = async(tab, command) => { + await browser.tabs.sendMessage(tab.id, { + type: messages.CONSOLE_SHOW_COMMAND, + command, + }); + return { type: '' }; +}; + +const showFind = async(tab) => { + await browser.tabs.sendMessage(tab.id, { + type: messages.CONSOLE_SHOW_FIND + }); + return { type: '' }; +}; + +const hide = async(tab) => { + await browser.tabs.sendMessage(tab.id, { + type: messages.CONSOLE_HIDE, + }); + return { type: '' }; +}; + +export { error, info, showCommand, showFind, hide }; |