0

i know this is pretty simple but i dont get it done anyway... :( I want the script to automaticly klick the playbutton on a spotify page (like this one: Spotify Page). So when the page is loaded the script should start the song by itself.

  • What have you tried so far? Show us some code, do you want it as an extension, or enter it in the console? – Adam Jul 05 '16 at 22:52
  • Take a look at user scripts, such as TamperMonkey for Chrome or Greasy Fork for Firefox. When you have some code you can come back and ask something specific. – yuriy636 Jul 05 '16 at 22:53
  • Possibly duplicate of http://stackoverflow.com/questions/24278469/click-a-button-programmatically-js – Adam Jul 05 '16 at 22:54

1 Answers1

0

Clicks can be programmatically triggered. On this particular page the play button's ID is "play-button".

jQuery

$(document).ready(function() {
  $("#play-button").click();
})

Vanilla JS

window.onload() = function() {
  document.getElementById("play-button").click();
}
Erik Engervall
  • 269
  • 1
  • 8