Skip to content

Instantly share code, notes, and snippets.

@egorvinogradov
Created February 5, 2023 08:38
Show Gist options
  • Save egorvinogradov/4f9180083251a6110df54d9555c00093 to your computer and use it in GitHub Desktop.
Save egorvinogradov/4f9180083251a6110df54d9555c00093 to your computer and use it in GitHub Desktop.
javascript:(function(text){
let textarea = document.querySelector('form textarea');
let event = new Event('input', { bubbles: true });
let nativeInputValueSetter = Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, 'value').set;
nativeInputValueSetter.call(textarea, text + '\n\n' + textarea.value);
textarea.dispatchEvent(event);
})('--- TEXT ---')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment