aboutsummaryrefslogtreecommitdiff
path: root/src/content/actions/addon.js
blob: b30cf16b91ac21ddd2511763742cb5b1319bfcb0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import messages from 'shared/messages';
import actions from 'content/actions';

const enable = () => setEnabled(true);

const disable = () => setEnabled(false);

const setEnabled = async(enabled) => {
  await browser.runtime.sendMessage({
    type: messages.ADDON_ENABLED_RESPONSE,
    enabled,
  });
  return {
    type: actions.ADDON_SET_ENABLED,
    enabled,
  };
};

export { enable, disable, setEnabled };