1
2
3
4
5
6
7
8
|
// Background
"use strict";
function showError (e) {
console.error(e.fileName + "\n" + e.name + "\nline: " + e.lineNumber + "\n" + e.message);
}
|
|
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
|
// Background
/* jshint esversion:6, -W097 */
/* jslint esversion:6 */
/* global GrammalectePanel, oGrammalecte, helpers, showError, Worker, chrome, console */
"use strict";
function showError (e) {
console.error(e.fileName + "\n" + e.name + "\nline: " + e.lineNumber + "\n" + e.message);
}
|
248
249
250
251
252
253
254
255
256
257
258
259
260
261
|
break;
default:
console.log("[background] Unknown command: " + sCommand);
console.log(oRequest);
}
});
//xPort.postMessage({sActionDone: "newId", result: iPortId});
}
browser.runtime.onConnect.addListener(handleConnexion);
/*
Context Menu
|
>
|
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
|
break;
default:
console.log("[background] Unknown command: " + sCommand);
console.log(oRequest);
}
});
//xPort.postMessage({sActionDone: "newId", result: iPortId});
xPort.postMessage({sActionDone: "init", sUrl: browser.extension.getURL("")});
}
browser.runtime.onConnect.addListener(handleConnexion);
/*
Context Menu
|
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
|
let xPort = dConnx.get(xTab.id);
xPort.postMessage({sActionDone: "rescanPage"});
break;
default:
console.log("[Background] Unknown menu id: " + xInfo.menuItemId);
console.log(xInfo);
console.log(xTab);
}
});
/*
Keyboard shortcuts
*/
browser.commands.onCommand.addListener(function (sCommand) {
|
|
|
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
|
let xPort = dConnx.get(xTab.id);
xPort.postMessage({sActionDone: "rescanPage"});
break;
default:
console.log("[Background] Unknown menu id: " + xInfo.menuItemId);
console.log(xInfo);
console.log(xTab);
}
});
/*
Keyboard shortcuts
*/
browser.commands.onCommand.addListener(function (sCommand) {
|