Skip to content

Instantly share code, notes, and snippets.

@eheikes
Last active May 12, 2018 16:58
Show Gist options
  • Save eheikes/07922bb0e5b50a1152e7 to your computer and use it in GitHub Desktop.
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).
(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