javascript - How can I click on the next button programmaticly using console in gmail to view older mails? -


i want click on next button in gmail using console can vie wmy older mails. possible?

i have found id of button using doesn't seem anything

document.getelementbyid(":hc").click(); 

the ids seems dynamic yes see older mails try below given code:-

  function clicknext(id) {         var cl = document.getelementbyid(id);         triggermouseevent(cl, "mousedown");          triggermouseevent(cl, "mouseup");     } 

and trigger mouse event function code:-

function triggermouseevent (node, eventtype) {     var clickevent = document.createevent ('mouseevents');     clickevent.initevent (eventtype, true, true);     node.dispatchevent (clickevent); } 

in clicknext function pass id of button in case below code working fine , able see older mails in gmail:-

clicknext(":jh"); 

Comments