episodes dropdown for vidcloud9.com

dropdown adds a dropdown menu to navigate between episodes faster

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         episodes dropdown for vidcloud9.com
// @description  dropdown adds a dropdown menu to navigate between episodes faster
// @match        https://vidcloud9.com/videos/*
// @version 0.0.1.20210801224626
// @namespace https://greasyfork.org/users/798407
// ==/UserScript==

let vidLeft = document.querySelector(".video-info-left");
let videoElem = document.querySelector(".watch_play");
let episodesUrls = new Array();
let episodesRaw = document.querySelector(".lists").querySelectorAll("a");
episodesRaw.forEach(function (e, i) {
    episodesUrls[i] = e.href;
  });
episodesUrls.reverse();
let currentEpisode = episodesUrls.indexOf(window.location.href);
let select = document.createElement("select");
function createOptions(url, i) {
  let option = document.createElement("option");
  option.value = url;
  option.text = "Episode " + (i + 1);
  if (i === currentEpisode) option.selected = "selected";
  return option;
};
episodesUrls.forEach(function (e, i) {
  select.add(createOptions(e, i), null);
});
let br = document.createElement("br");
vidLeft.insertBefore(br, videoElem);
vidLeft.insertBefore(select, videoElem);
select.addEventListener("change", function () {
  window.location.href = select.value;
});