aboutsummaryrefslogtreecommitdiff
path: root/src/background/actions/console.js
diff options
context:
space:
mode:
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 };