diff options
author | Wojtek Kosior <koszko@koszko.org> | 2021-06-30 12:28:05 +0200 |
---|---|---|
committer | Wojtek Kosior <koszko@koszko.org> | 2021-06-30 12:28:05 +0200 |
commit | 261548ff184926567a623e90df7954aeef842d59 (patch) | |
tree | 9b5697a77c758eaae969a8fba8b4edea5ecf59d4 /background/message_server.js | |
parent | 83a8d263f6efddf4f742bf7a687d10bfd1907ef8 (diff) | |
download | browser-extension-261548ff184926567a623e90df7954aeef842d59.tar.gz browser-extension-261548ff184926567a623e90df7954aeef842d59.zip |
emply an sh-based build system; make some changes to blocking
Diffstat (limited to 'background/message_server.js')
-rw-r--r-- | background/message_server.js | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/background/message_server.js b/background/message_server.js index 358e9d5..a541a04 100644 --- a/background/message_server.js +++ b/background/message_server.js @@ -5,28 +5,33 @@ * Redistribution terms are gathered in the `copyright' file. */ -"use strict"; - -(() => { - const browser = window.browser; +/* + * IMPORTS_START + * IMPORT browser + * IMPORTS_END + */ - var listeners = {}; +var listeners = {}; - /* magic should be one of the constants from /common/connection_types.js */ +/* magic should be one of the constants from /common/connection_types.js */ - function listen_for_connection(magic, cb) - { - listeners[magic] = cb; - } +function listen_for_connection(magic, cb) +{ + listeners[magic] = cb; +} - function raw_listen(port) { - if (listeners[port.name] === undefined) - return; +function raw_listen(port) +{ + if (listeners[port.name] === undefined) + return; - listeners[port.name](port); - } + listeners[port.name](port); +} - browser.runtime.onConnect.addListener(raw_listen); +browser.runtime.onConnect.addListener(raw_listen); - window.listen_for_connection = listen_for_connection; -})(); +/* + * EXPORTS_START + * EXPORT listen_for_connection + * EXPORTS_END + */ |