Skip to content

Instantly share code, notes, and snippets.

@suvene
Created July 23, 2011 15:19
Show Gist options
  • Save suvene/1101541 to your computer and use it in GitHub Desktop.
Save suvene/1101541 to your computer and use it in GitHub Desktop.
javascript: (function() {
var es = document.getElementsByTagName('div');
function invokeMouseEvent(elem, evname) {
var e = document.createEvent('MouseEvents');
e.initMouseEvent(evname, true, true, e.view||window, 0, 0, 0, 0, 0,
false, false, false, false, 0, null);
elem.dispatchEvent(e);
}
for (var i = 0, len = es.length; i < len; i++) {
var e = es[i];
if (e.className == 'a-j-Db-Dq') {
invokeMouseEvent('click', e.parentNode);
}
}
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment