338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
|
browser.contextMenus.create({ id: "grammar_checker_page", title: "Analyser la page", contexts: ["all"] });
browser.contextMenus.create({ id: "separator_tools", type: "separator", contexts: ["all"] });
// Tools
browser.contextMenus.create({ id: "conjugueur_tab", title: "Conjugueur [onglet]", contexts: ["all"] });
browser.contextMenus.create({ id: "conjugueur_window", title: "Conjugueur [fenêtre]", contexts: ["all"] });
//browser.contextMenus.create({ id: "dictionaries", title: "Dictionnaires", contexts: ["all"] });
browser.contextMenus.create({ id: "lexicon_editor", title: "Éditeur lexical", contexts: ["all"] });
// Rescan page
browser.contextMenus.create({ id: "separator_rescan", type: "separator", contexts: ["editable"] });
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) {
|
<
<
|
338
339
340
341
342
343
344
345
346
347
348
349
350
351
|
browser.contextMenus.create({ id: "grammar_checker_page", title: "Analyser la page", contexts: ["all"] });
browser.contextMenus.create({ id: "separator_tools", type: "separator", contexts: ["all"] });
// Tools
browser.contextMenus.create({ id: "conjugueur_tab", title: "Conjugueur [onglet]", contexts: ["all"] });
browser.contextMenus.create({ id: "conjugueur_window", title: "Conjugueur [fenêtre]", contexts: ["all"] });
//browser.contextMenus.create({ id: "dictionaries", title: "Dictionnaires", contexts: ["all"] });
browser.contextMenus.create({ id: "lexicon_editor", title: "Éditeur lexical", contexts: ["all"] });
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) {
|