It works but at least for me it showed an error message about
Uncaught SyntaxError: illegal character U+2018
and it has to do with wrong quotes
So I had to modify the script to this:
document.querySelectorAll('*').forEach(el => {
if (el.scrollHeight > el.clientHeight) {
el.style.maxHeight = 'none';
el.style.overflowY = 'auto';
}
});