diff options
Diffstat (limited to 'src/content/actions/addon.ts')
-rw-r--r-- | src/content/actions/addon.ts | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/content/actions/addon.ts b/src/content/actions/addon.ts new file mode 100644 index 0000000..b30cf16 --- /dev/null +++ b/src/content/actions/addon.ts @@ -0,0 +1,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 }; |