Skip to content

Commit faff12b

Browse files
added basic service worker config to writing extension
1 parent c3469ce commit faff12b

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

‎VERSION‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.0+2025.10.14T13.37.19.878Z.ec3193cb.master
1+
0.1.0+2025.10.15T14.41.46.897Z.c3469ce8.master

‎extension/writing-process/src/background.js‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,7 @@
22
Background script. This works across all of Google Chrome.
33
*/
44

5-
// Do not save debug requests. We flip this frequently. Perhaps this
6-
// should be a cookie or browser.storage?
7-
var RAW_DEBUG = false;
8-
9-
/* This variable must be manually updated to specify the server that
10-
* the data will be sent to.
11-
*/
12-
var WEBSOCKET_SERVER_URL = "wss://learning-observer.org/wsapi/in/";
13-
5+
import { CONFIG } from "./service_worker_config.js";
146
import { googledocs_id_from_url } from './writing_common';
157

168
import * as loEvent from 'lo_event/lo_event/lo_event.js';
@@ -21,6 +13,8 @@ import { browserInfo } from 'lo_event/lo_event/metadata/browserinfo.js';
2113
import { chromeAuth } from 'lo_event/lo_event/metadata/chromeauth.js';
2214
import { localStorageInfo, sessionStorageInfo } from 'lo_event/lo_event/metadata/storage.js';
2315

16+
const { RAW_DEBUG, WEBSOCKET_SERVER_URL } = CONFIG;
17+
2418
// We would like to support fetching the websocket server from storage
2519

2620
// callback = new Promise((resolve, reject) => {
@@ -35,7 +29,6 @@ let loEventActive = false;
3529
let loggers = [];
3630
const manifestVersion = chrome.runtime.getManifest().version;
3731

38-
3932
// We are not sure if this should be done within `websocketLogger()`'s `init`
4033
// or one level up.
4134
function startLogger () {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// service_worker_config.js
2+
export const CONFIG = {
3+
// Flag for logging `raw_http_request` events
4+
RAW_DEBUG: false,
5+
// Learning Observer websocket connection endpoint
6+
WEBSOCKET_SERVER_URL: "wss://learning-observer.org/wsapi/in/",
7+
};

0 commit comments

Comments
 (0)