Skip to content

Instantly share code, notes, and snippets.

@cahva
Created January 20, 2020 12:22
Show Gist options
  • Save cahva/b72c93e306648c182d89016b4fa72a07 to your computer and use it in GitHub Desktop.
Save cahva/b72c93e306648c182d89016b4fa72a07 to your computer and use it in GitHub Desktop.
Open commentform and set the height
<script>
/* wait for element to be ready */
function tryEl(e) {
var privEl = document.querySelector('.comment-feed-header')[0];
if (!privEl) {
window.requestAnimationFrame(tryEl);
} else {
changeAndClick(privEl);
}
}
function changeAndClick(el) {
document.getElementById('comment-text').style.height = '40px';
if (el.children[0].children[0]) {
el.children[0].children[0].click();
}
}
tryEl();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment