Skip to content

Instantly share code, notes, and snippets.

@ellm
Created May 18, 2018 15:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ellm/b76fe2b529829cf67a11676e7d279528 to your computer and use it in GitHub Desktop.
Save ellm/b76fe2b529829cf67a11676e7d279528 to your computer and use it in GitHub Desktop.
PlugDJ - dance/woot every song automagically πŸ‘―β€β™€οΈ
const playing = document.querySelector('.community__song-playing');
const btn = document.querySelector('button.btn-like');
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
if (mutation.type == "attributes") {
btn.click();
console.log("me_debug", "playing attributes changed")
}
});
});
observer.observe(playing, {
attributes: true //configure it to listen to attribute changes
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment