Edit text in Facebook Messenger contenteditable

To compose messages in Messenger, Facebook uses

as the input element. When I open browser devtools and change the text of the message I’m currently composing, it immediately reverts back to the previous text.

I’m making a Find & Replace extension (https://find-and-replace-f6588.firebaseapp.com/) that needs to be able to insert text into the contenteditable but simply changing the DOM node is immediately reverted by their JavaScript.

Is there any other way to simulate typing in the input text (using a browser extension or JavaScript in general)?

UPDATE: I can duplicate the DOM node and then the JavaScript listeners are removed, but then the internal JavaScript variables are never updated with my new text.