// ==UserScript== // @name Animephae next/prev buttons on player // @namespace http://tampermonkey.net/ // @version 0.1 // @description Adds next and prev buttons on the player on animephae // @author Jin Park // @match https://animepahe.com/play/* // @icon https://www.google.com/s2/favicons?domain=animepahe.com // @grant none // @downloadURL none // ==/UserScript== /* jshint esversion:6 */ (function() { 'use strict'; const next = document.querySelector("[aria-labelledby='episodeMenu']").getElementsByClassName('active')[0].nextElementSibling; const prev = document.querySelector("[aria-labelledby='episodeMenu']").getElementsByClassName('active')[0].previousElementSibling; let nextButtonStr = '' let prevButtonStr = '' let buttonStyleStr = `` const player = document.getElementsByClassName('player')[0] const parser = new DOMParser(); const nextButton = parser.parseFromString(nextButtonStr, 'text/html').getElementsByTagName('button')[0]; const prevButton = parser.parseFromString(prevButtonStr, 'text/html').getElementsByTagName('button')[0]; const buttonStyle = parser.parseFromString(buttonStyleStr, 'text/html').getElementsByTagName('style')[0]; if (next) { player.appendChild(nextButton) } if (prev) { player.appendChild(prevButton) } document.body.appendChild(buttonStyle) })();