Grammalecte  Diff

Differences From Artifact [a4e3a48dc5]:

To Artifact [92282c126d]:


1
2
3











4
5
6
7
8
9
10



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
-
-
-
+
+
+
+
+
+
+
+
+
+
+







// Background script
// for calling the grammar checker engine

/*
import { echo } from "mymodule";

try {
    echo("It works! At last!");
}
catch (e) {
    console.error(e);
}
*/
"use strict";

let gce = null; // module: grammar checker engine
let text = null;
let tkz = null; // module: tokenizer
let lxg = null; // module: lexicographer
let helpers = null;

109
110
111
112
113
114
115
116

117
118
119
120







117
118
119
120
121
122
123

124
125
126
127
128
129
130
131
132
133
134
135







-
+




+
+
+
+
+
+
+
        helpers.logerror(e);
    }
    return JSON.stringify([]);
}


function handleMessage (oRequest, xSender, sendResponse) {
  console.log(`content script sent a message: ${oRequest.content}`);
  console.log(`[background] received: ${oRequest.content}`);
  sendResponse({response: "response from background script"});
}

browser.runtime.onMessage.addListener(handleMessage);

try {
    loadGrammarChecker();
}
catch (e) {
    console.error(e);
}