Greasy Fork

Spoiler-free Crunchyroll

Hide name and description of episodes

当前为 2017-12-13 提交的版本,查看 最新版本

// ==UserScript==
// @name          Spoiler-free Crunchyroll
// @description   Hide name and description of episodes
// @author        TimeBomb
// @match         http://www.crunchyroll.com/*
// @version       0.1
// @copyright     2017
// @namespace https://greasyfork.org/users/160017
// ==/UserScript==

(function() {
    function truncateEpisodeName() {
        var text = $(this).html();
        var textTruncateIndex = text.indexOf('–');
        if (textTruncateIndex > -1) {
            $(this).html(text.substr(0, textTruncateIndex));
        }
    }

    function clearText() {
        $(this).text('');
    }

    // Very crude and fragile. Good luck.
    $('.short-desc').each(clearText);
    $('.collection-carousel-overlay-bottom.ellipsis.xsmall-margin-bottom').each(clearText);
    $('#showmedia_about_name').each(clearText);
    $('.series-data').each(truncateEpisodeName);
    $('h1.ellipsis').each(truncateEpisodeName);
    $('.description.medium-margin-bottom').each(clearText);
})();