Shikimori View Button

Возвращает на новый домен кнопку "Смотреть"; на play.shikimori.org меняет ссылки, для возвращения на страницу с новым доменом

当前为 2019-05-18 提交的版本,查看 最新版本

// ==UserScript==
// @name         Shikimori View Button
// @namespace    http://shikimori.one/
// @version      1.0
// @description  Возвращает на новый домен кнопку "Смотреть"; на play.shikimori.org меняет ссылки, для возвращения на страницу с новым доменом
// @author       Jogeer
// @match        https://shikimori.one/*
// @match        https://play.shikimori.org/*
// @grant        none
// @require      http://code.jquery.com/jquery-3.3.1.min.js
// @require      https://gf.qytechs.cn/scripts/5392-waitforkeyelements/code/WaitForKeyElements.js
// ==/UserScript==

//Эта хрень делает ваш код рабочим при переходе по страницам с AJAX'ом
waitForKeyElements (
    "body",
    unique
);

//Эта основной код который работает (возможно)
function unique() {
    //это переменные
    var link = window.location.pathname,
        button = '.watch-online-placeholer',
        ce = Number($('.current-episodes').text()) + 1;

    //это стили для кнопки "Смотреть"
    $(button).css({"background": "#19282b", "width": "calc(100% - 40px)", "height": "30px", "text-align": "center", "margin": "0 20px", "color": "#eee", "font-size": "18px", "cursor": "pointer"});
    $(button).text("Смотреть");

    //А это код, который заменяет ссылки и добовляет кнопки
    if (window.location.hostname == 'shikimori.one') {
        $(button).on('click', function(event) {
            event.preventDefault();
            location.replace('https://play.shikimori.org/' + link + '/video_online/' + ce);
        });
    };
    if (window.location.hostname == 'play.shikimori.org') {
        var url = $(".l-menu .b-animes-menu .b-menu_logo > center > a").attr('href');
        $(".l-menu .b-animes-menu .b-menu_logo > center > a").attr('href', url.slice(0,19) + 'ne' + url.slice(21));
    };
};

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址