Skip to content

Instantly share code, notes, and snippets.

@asciimo
Created November 27, 2012 23:46
Show Gist options
  • Select an option

  • Save asciimo/4158009 to your computer and use it in GitHub Desktop.

Select an option

Save asciimo/4158009 to your computer and use it in GitHub Desktop.
Fill your GooglePlay cart with Nexuses and drop this script in your Chrome console.
function simulateClick(element) {
var oEvent;
oEvent = document.createEvent("MouseEvents");
oEvent.initMouseEvent("click", true, true, document.defaultView);
element.dispatchEvent(oEvent);
return element;
}
var myButton = document.getElementsByClassName("buy-button-price")[1];
var myInterval = setInterval(function(){simulateClick(myButton)}, 2000);
// After you "win," be nice and run the following statement to stop the clicking
// clearInterval(myInterval);
@Eunoia
Copy link

Eunoia commented Nov 28, 2012

Nice, you can also call click() on myButton.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment