Index: gc_lang/fr/webext/content_scripts/init.js ================================================================== --- gc_lang/fr/webext/content_scripts/init.js +++ gc_lang/fr/webext/content_scripts/init.js @@ -274,10 +274,11 @@ catch (e) { showError(e); } } }; + /* Connexion to the background */ let xGrammalectePort = browser.runtime.connect({name: "content-script port"}); @@ -319,11 +320,11 @@ */ // Grammar checker commands case "rightClickGCEditableNode": if (oGrammalecte.xRightClickedNode !== null) { oGrammalecte.startGCPanel(oGrammalecte.xRightClickedNode); - sText = oGrammalecte.xRightClickedNode.tagName == "TEXTAREA" ? oGrammalecte.xRightClickedNode.value : oGrammalecte.xRightClickedNode.innerText; + sText = (oGrammalecte.xRightClickedNode.tagName == "TEXTAREA") ? oGrammalecte.xRightClickedNode.value : oGrammalecte.xRightClickedNode.innerText; xGrammalectePort.postMessage({ sCommand: "parseAndSpellcheck", dParam: {sText: sText, sCountry: "FR", bDebug: false, bContext: false}, dInfo: {sTextAreaId: oGrammalecte.xRightClickedNode.id} }); @@ -345,11 +346,11 @@ break; // Lexicographer commands case "rightClickLxgEditableNode": if (oGrammalecte.xRightClickedNode !== null) { oGrammalecte.startLxgPanel(); - sText = oGrammalecte.xRightClickedNode.tagName == "TEXTAREA" ? oGrammalecte.xRightClickedNode.value : oGrammalecte.xRightClickedNode.innerText; + sText = (oGrammalecte.xRightClickedNode.tagName == "TEXTAREA") ? oGrammalecte.xRightClickedNode.value : oGrammalecte.xRightClickedNode.innerText; xGrammalectePort.postMessage({ sCommand: "getListOfTokens", dParam: {sText: sText}, dInfo: {sTextAreaId: oGrammalecte.xRightClickedNode.id} });