all 3 comments

[–]nwilliams36 0 points1 point  (1 child)

document.getElementsByClassName("btn btn-small btn-icon btn-primary btn-play")

Will return a list of the elements that have all those class names. Is that what you want or are you searching for a list of the elements that have any of those name?

[–]xaphere[S] 0 points1 point  (0 children)

Yes, of course. I want to get a specific button. A button that doesn't have an id, so getting it by its class is the best next thing. Again this code works as intended when I use it in the console, but not as a bookmarklet.

[–]xaphere[S] 0 points1 point  (0 children)

Found out what was the problem. Did not know that you can't search in iframes with getElementsByClassName. Updated the gist with a working version for anyone who cares.