Advertisement
Guest User

autoplay

a guest
Jun 25th, 2018
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. new WebKitMutationObserver(function(mutations) {
  2.     mutations.forEach(function(mutation) {
  3.         if (!mutation.addedNodes) return;
  4.         [].map.call(mutation.addedNodes, function xPlay(el) {
  5.             if (el.nodeType != 1) return;
  6.             var play = geByClass1('audio-msg-track--btn', el);
  7.             if(!play || play.played) return;
  8.             play.played = 1;
  9.             play.click();
  10.             console.log('play', play, el);
  11.         });
  12.     });
  13. }).observe(document.body, {
  14.     childList: true,
  15.     subtree: true
  16. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement