aboutsummaryrefslogtreecommitdiff
path: root/src/background/actions/console.js
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2018-07-08 21:20:49 +0900
committerGitHub <noreply@github.com>2018-07-08 21:20:49 +0900
commit37840c2abb02948d36cdcfaab9063f3ea67fdb6b (patch)
tree2662c396dea1761f57ed508616d2c76389aba5f9 /src/background/actions/console.js
parent9f64b19bef06328999a5ed602ba89867402b9d5c (diff)
parent43beccfe0f323e2363fe97bdb6bc0d71558fda47 (diff)
Merge pull request #429 from ueokande/use-official-redux
Use official redux
Diffstat (limited to 'src/background/actions/console.js')
-rw-r--r--src/background/actions/console.js41
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 };