diff options
author | Wojtek Kosior <koszko@koszko.org> | 2021-12-22 16:39:34 +0100 |
---|---|---|
committer | Wojtek Kosior <koszko@koszko.org> | 2021-12-22 16:39:34 +0100 |
commit | b590eaa2f64ead3384eadc6fe58f6358aa1a0478 (patch) | |
tree | 8f1e9403c1a75246c2a9a0afc4ab30706ea7afbe /content/activity_info_server.js | |
parent | b7378a9994724750198e0d165c575be8538334fb (diff) | |
download | browser-extension-b590eaa2f64ead3384eadc6fe58f6358aa1a0478.tar.gz browser-extension-b590eaa2f64ead3384eadc6fe58f6358aa1a0478.zip |
reworked build system; added missing license notices
Diffstat (limited to 'content/activity_info_server.js')
-rw-r--r-- | content/activity_info_server.js | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/content/activity_info_server.js b/content/activity_info_server.js index c1b9736..db8ff80 100644 --- a/content/activity_info_server.js +++ b/content/activity_info_server.js @@ -42,15 +42,10 @@ * proprietary program, I am not going to enforce this in court. */ -/* - * IMPORTS_START - * IMPORT listen_for_connection - * IMPORT CONNECTION_TYPE - * IMPORT repo_query - * IMPORT subscribe_repo_query_results - * IMPORT unsubscribe_repo_query_results - * IMPORTS_END - */ +#IMPORT common/connection_types.js AS CONNECTION_TYPE +#IMPORT content/repo_query.js + +#FROM common/message_server.js IMPORT listen_for_connection var activities = []; var ports = new Set(); @@ -73,6 +68,7 @@ function report_script(script_data) { report_activity("script", script_data); } +#EXPORT report_script function report_settings(settings) { @@ -80,11 +76,13 @@ function report_settings(settings) Object.assign(settings_clone, settings) report_activity("settings", settings_clone); } +#EXPORT report_settings function report_document_type(is_html) { report_activity("is_html", is_html); } +#EXPORT report_document_type function report_repo_query_action(update, port) { @@ -93,13 +91,13 @@ function report_repo_query_action(update, port) function trigger_repo_query(query_specifier) { - repo_query(...query_specifier); + repo_query.query(...query_specifier); } function handle_disconnect(port, report_action) { ports.delete(port) - unsubscribe_repo_query_results(report_action); + repo_query.unsubscribe_results(report_action); } function new_connection(port) @@ -112,7 +110,7 @@ function new_connection(port) port.postMessage(activity); const report_action = u => report_repo_query_action(u, port); - subscribe_repo_query_results(report_action); + repo_query.subscribe_results(report_action); /* * So far the only thing we expect to receive is repo query order. Once more @@ -123,16 +121,8 @@ function new_connection(port) port.onDisconnect.addListener(() => handle_disconnect(port, report_action)); } -function start_activity_info_server() +function start() { listen_for_connection(CONNECTION_TYPE.ACTIVITY_INFO, new_connection); } - -/* - * EXPORTS_START - * EXPORT start_activity_info_server - * EXPORT report_script - * EXPORT report_settings - * EXPORT report_document_type - * EXPORTS_END - */ +#EXPORT start |