EgyBest next and previous buttons

هذا الكود يضيف لك امكانية الولوج الى الحلقة التالية او السابقة بسهولة فقط بالضغط على الزر تحت مشغل الحلقة

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         EgyBest next and previous buttons
// @version      0.1
// @description  هذا الكود يضيف لك امكانية الولوج الى الحلقة التالية او السابقة بسهولة فقط بالضغط على الزر تحت مشغل الحلقة
// @author       bil-X
// @match        https://sela.egybest.xyz/episode/*
// @grant        none
// @namespace https://greatest.deepsurf.us/users/428705
// ==/UserScript==

(function() {
    'use strict';

    var ss = document.createElement('script');
    ss.text = 'function fresh(a){document.location.replace(a);};' ;
    document.head.appendChild(ss);

    var url = window.location.href;

    var c = document.getElementsByClassName("mbox tam")[0];
    var nextURL= url.replace(url.match(/ep-(\d+)/)[0],"ep-" + (Number(url.match(/ep-(\d+)/)[1]) + 1) );
    var prevURL= url.replace(url.match(/ep-(\d+)/)[0],"ep-" + (Number(url.match(/ep-(\d+)/)[1]) - 1) );
    var sp = document.createElement("label");
    var btnNext = document.createElement("button");
    var btnPrev = document.createElement("button");

    btnNext.setAttribute("class","btn b vam");
    btnPrev.setAttribute("class","btn b vam");

    btnNext.setAttribute("id","nxt");
    btnPrev.setAttribute("id","prv");

    btnNext.setAttribute("value",nextURL);
    btnPrev.setAttribute("value",prevURL);

    btnNext.setAttribute('onclick','fresh(this.getAttribute("value"))');
    btnPrev.setAttribute('onclick','fresh(this.getAttribute("value"))');

    btnNext.innerText = "الحلقة التالية";
    btnPrev.innerText = "الحلقة السابقة";

    btnNext.setAttribute("style",'font-family: inherit;');
    btnPrev.setAttribute("style",'font-family: inherit;');

    sp.innerText = "      ";
    c.appendChild(document.createElement("br"));
    c.appendChild(btnNext);c.appendChild(sp);
    c.appendChild(btnPrev);
})();