8muses Improved

Improvements to 8muses: move breadcrumb to sidebar and hide header on image pages, hide title attribute on image pages, hide empty/ad sections in the sidebar

14.01.2021 itibariyledir. En son verisyonu görün.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         8muses Improved
// @namespace    Hentiedup
// @version      0.1.1
// @description  Improvements to 8muses: move breadcrumb to sidebar and hide header on image pages, hide title attribute on image pages, hide empty/ad sections in the sidebar
// @author       Hentiedup
// @match        https://comics.8muses.com/*
// @grant        none
// @noframes
// ==/UserScript==

(function() {
    'use strict';

    //========================= OPTIONS =========================//
           var moveBreadcrumbsAndHideHeaderOnImages = true;
           var hideTitleAttributeFromImages         = true;
           var hideEmptyOrAdSectionsFromSidebar     = true;
    //===========================================================//

    if(hideEmptyOrAdSectionsFromSidebar)
    {
        let targets = document.querySelectorAll(".menu-items > .ui-menu-item > a[rel=noopener]");
        for(let i = 0; i < targets.length; i++)
        {
            targets[i].parentNode.style.display = "none";
        }
    }

    if(window.location.href.includes("/comics/picture/"))
    {
        if(hideTitleAttributeFromImages)
            document.querySelector(".photo > a").setAttribute("title", "");

        if(moveBreadcrumbsAndHideHeaderOnImages)
        {
            var breadcrumb = document.querySelector(".top-menu-breadcrumb").cloneNode(true);
            breadcrumb.setAttribute("id", "newBreadcrumb");
            document.getElementById("top-menu").style.display = "none";
            document.getElementById("left-menu").style.paddingTop = "0";
            document.getElementById("left-menu-close").style.display = "none";
            document.getElementById("b-wrapper").style.paddingTop = "0";
            document.querySelector(".menu-items > .menu-logo").className = "";

            let beforeTarget = document.querySelector(".page-select");
            beforeTarget.parentNode.insertBefore(breadcrumb, beforeTarget);

            var lis = document.getElementById("newBreadcrumb").getElementsByTagName("li");
            let ol = document.getElementById("newBreadcrumb").getElementsByTagName("ol")[0];
            ol.style.listStyle = "none";
            ol.style.padding = "10px 0";
            for(let i = 0; i < lis.length; i++)
            {
                if(i != 0)
                    lis[i].insertBefore(document.createTextNode("⤷ "), lis[i].firstChild);

                lis[i].style.lineHeight = "1.2em";
                lis[i].style.padding = "0 10px";
            }
        }
    }
})();