354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
|
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
|
+
-
-
-
-
-
+
|
break;
default:
console.log("[background] Unknown command: " + sCommand);
console.log(oRequest);
}
});
//xPort.postMessage({sActionDone: "newId", result: iPortId});
//console.log("[Grammalecte] init connection to content-script");
xPort.postMessage({sActionDone: "init", sUrl: browser.extension.getURL("")});
}
browser.runtime.onConnect.addListener(handleConnexion);
/*
ComposeAction
(Thunderbird only)
*/
if (bThunderbird) {
console.log("[Grammalecte] Thunderbird: listening compose action...");
browser.composeAction.onClicked.addListener(function (xTab, xData) {
console.log("ComposeAction clicked");
console.log(xTab);
console.log(xData);
browser.tabs.sendMessage(xTab.id, {sActionRequest: "grammar_checker_compose_window"});
sendCommandToTab(xTab.id, "grammar_checker_compose_window");
});
}
/*
Context Menu
(not for MailExtension)
|