193
194
195
196
197
198
199
200
201
202
203
204
205
206
|
browser.contextMenus.create({
id: "separator_selection",
type: "separator",
contexts: ["selection"]
});
// Editable content
browser.contextMenus.create({
id: "rightClickLxgEditableNode",
title: "Lexicographe (zone de texte)",
contexts: ["editable"]
});
browser.contextMenus.create({
|
>
>
>
>
>
>
|
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
|
browser.contextMenus.create({
id: "separator_selection",
type: "separator",
contexts: ["selection"]
});
// Editable content
browser.contextMenus.create({
id: "rightClickTFEditableNode",
title: "Formateur de texte (zone de texte)",
contexts: ["editable"]
});
browser.contextMenus.create({
id: "rightClickLxgEditableNode",
title: "Lexicographe (zone de texte)",
contexts: ["editable"]
});
browser.contextMenus.create({
|
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
|
browser.contextMenus.onClicked.addListener(function (xInfo, xTab) {
// xInfo = https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/contextMenus/OnClickData
// xTab = https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/tabs/Tab
// confusing: no way to get the node where we click?!
switch (xInfo.menuItemId) {
// editable node
// page
case "rightClickGCEditableNode":
case "rightClickLxgEditableNode":
case "rightClickGCPage":
case "rightClickLxgPage":
sendCommandToTab(xInfo.menuItemId, xTab.id);
break;
// selected text
case "rightClickGCSelectedText":
sendCommandToTab("rightClickGCSelectedText", xTab.id);
xGCEWorker.postMessage({
sCommand: "parseAndSpellcheck",
|
|
|
>
|
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
|
browser.contextMenus.onClicked.addListener(function (xInfo, xTab) {
// xInfo = https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/contextMenus/OnClickData
// xTab = https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/tabs/Tab
// confusing: no way to get the node where we click?!
switch (xInfo.menuItemId) {
// editable node
// page
case "rightClickTFEditableNode":
case "rightClickLxgEditableNode":
case "rightClickGCEditableNode":
case "rightClickLxgPage":
case "rightClickGCPage":
sendCommandToTab(xInfo.menuItemId, xTab.id);
break;
// selected text
case "rightClickGCSelectedText":
sendCommandToTab("rightClickGCSelectedText", xTab.id);
xGCEWorker.postMessage({
sCommand: "parseAndSpellcheck",
|