199 if(!inputArea || !iconSelectorRoot) return;
200 const text = inputArea.innerText.trimStart();
201 const isInputChanged = (currentChatText !== text);
202 currentChatText = text + "";203 if(e.key === "Escape")
204 {
205 try
254 */
255 try
256 {
257 currentChatText = text + "";258 makeStatsFromInput(currentChatText);
259 toggleSelector(false);
260 }
191chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
192 console.log('runtime.onMessage -- ' +
193 ("tab" in sender ?
194 "from a content script:" + sender.tab.url :195 "from the extension"));
196
197 if(request.command === "refresh_all")
189
190
191chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
192 console.log('runtime.onMessage -- ' + 193 ("tab" in sender ?194 "from a content script:" + sender.tab.url :195 "from the extension"));196
197 if(request.command === "refresh_all")
198 {
In ES2015 (ES6), we can use template literals instead of string concatenation.
var str = `Hello, ${name}!`;
var str = "Hello, " + name + "!";
var str = "Time: " + (12 * 60 * 60 * 1000);
var str = "Hello World!";
var str = `Hello, ${name}!`;
var str = `Time: ${12 * 60 * 60 * 1000}`;
var str = "Hello, " + "World!";