summaryrefslogtreecommitdiff
path: root/background/message_server.js
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2021-06-30 12:28:05 +0200
committerWojtek Kosior <koszko@koszko.org>2021-06-30 12:28:05 +0200
commit261548ff184926567a623e90df7954aeef842d59 (patch)
tree9b5697a77c758eaae969a8fba8b4edea5ecf59d4 /background/message_server.js
parent83a8d263f6efddf4f742bf7a687d10bfd1907ef8 (diff)
downloadbrowser-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.js41
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
+ */