I trying send a command throught my contentScript file to remove last character of a string in a <input>
field that was inserted by user.
Already tried several ways found on web but nothing worked.
My last attempt as with TextEvent
(like code below), but without success.
contentScript.js - Reference
document.getElementById("inputTextId").value = "Some string inserted by user";
var textEvent = document.createEvent('TextEvent');
textEvent.initTextEvent('textInput', true, true, null, String.fromCharCode(13), 9, "en-US");
document.getElementById("inputTextId").dispatchEvent(textEvent);
Is really possible make this?