Last active
May 12, 2018 16:58
-
-
Save eheikes/07922bb0e5b50a1152e7 to your computer and use it in GitHub Desktop.
Randomly choose an item from your Netflix Instant queue. Run it on the My List page (after loading the whole page).
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(){ | |
var hd = document.querySelector('.main-header'); | |
var movies = [].slice.call(document.querySelectorAll('.slider-item')); | |
var len = movies.length; | |
var i = Math.floor(Math.random() * len) + 1; | |
var movie = movies[i-1]; | |
movies.forEach(function(movie) { movie.style.border = 'none'; }); | |
movie.style.border = '2px solid red'; | |
console.log(movie.querySelector('[aria-label]').getAttribute('aria-label')); | |
window.scrollBy(0, movie.getBoundingClientRect().top - hd.offsetHeight - 10); | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment