From 261548ff184926567a623e90df7954aeef842d59 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Wed, 30 Jun 2021 12:28:05 +0200 Subject: emply an sh-based build system; make some changes to blocking --- background/message_server.js | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) (limited to 'background/message_server.js') 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 + */ -- cgit v1.2.3