3

I'm trying to create a Chrome Extension which modifies the submitted message when the user presses enter in the chatbox. HTML-Code for textarea:

<textarea class="uiTextareaAutogrow input" onkeydown="Bootloader.loadComponents([&quot;control-textarea&quot;], function() { TextAreaControl.getInstance(this) }.bind(this)); "></textarea>

I tried to use something like this for onkeydown-event. I want to replace users message with the text 'test' when he presses Enter and submits the text

if (event.keyCode == 13) {this.value='test';}

But of course this doesn't work because facebooks javascript uses Eventlisteners and .bind so the value in the textarea changes AFTER the text is processed and submitted but I need to modify it BEFORE it is processed. Does somebody know how I could solve this?

Sk1p
  • 45
  • 5

0 Answers0