I hope somebody will help me to fix the issue.
I have a follow script for chrome console , it worked fine the last couple of days , however running it today I started to receive this Error ( below ) . I would highly appreciate if somebody can help me fix the code issue , the code and the error is attached below . Thanks in advance for help.
var jq = document.createElement('script');
jq.src = "//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"; //Loads JavaScript
document.getElementsByTagName('head')[0].appendChild(jq);
jQuery.noConflict()
window.setInterval(function(){
var x = 0;
$("button:contains('Follow')").each(
function(){ if($(this).text()=="Follow"){
if(x==2) return false;
$(this).trigger("click");
$('._4gt3b').scrollTop($('._4gt3b')[0].scrollHeight);
x++;}
}
)
$('._4gt3b').scrollTop($('._4gt3b')[0].scrollHeight); console.log('loop');
}, 70000);
Here is the error that I'm receiving after running the script
>VM137:7 Uncaught TypeError: Cannot read property 'scrollHeight' of undefined
at HTMLButtonElement.<anonymous> (<anonymous>:7:40)
at Function.each (jquery.min.js:2)
at n.fn.init.each (jquery.min.js:2)
at <anonymous>:3:32