EgyBest next and previous buttons

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

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         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);
})();