Created
May 18, 2018 15:13
-
-
Save ellm/b76fe2b529829cf67a11676e7d279528 to your computer and use it in GitHub Desktop.
PlugDJ - dance/woot every song automagically π―ββοΈ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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