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
function getBoundingClientRect(element) { | |
return new Promise(resolve => { | |
const observer = new IntersectionObserver(([entity]) => { | |
observer.unobserve(element); | |
observer.disconnect(); | |
resolve(entity.boundingClientRect); | |
}); | |
observer.observe(element); | |
}); |
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
// scroll down fully | |
var songs = document.querySelectorAll('.audio_row'); | |
var playlistId = '15359214_51903820'; | |
for (var i = songs.length - 1; i >= 0; i--) { | |
console.log(i, 'more'); | |
const mouseoverEvent = new Event('mouseover'); | |
songs[i].dispatchEvent(mouseoverEvent); | |
await new Promise((a)=>setTimeout(a, 500)); | |
songs[i].querySelector('.audio_row__action_more').click(); |