aboutsummaryrefslogtreecommitdiff
path: root/src/background/actions/console.js
blob: d385b2db3fae04f6b6b9cdd21b008968c86bf7bd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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 };