Greasy Fork

Hide bullshit on filmweb.pl

Hides annoying sections on filmweb.pl

目前为 2023-05-18 提交的版本。查看 最新版本

// ==UserScript==
// @name        Hide bullshit on filmweb.pl
// @version     1.0
// @description Hides annoying sections on filmweb.pl
// @author      cphx
// @homepage    none
// @icon        https://filmweb.pl/favicon.ico
// @match       https://www.filmweb.pl/*
// @run-at      document-end
// @namespace https://greasyfork.org/users/1080913
// ==/UserScript==

if (location.pathname !== "/") {
    const addGlobalStyle = (css) => {
        const style = document.createElement("style");
        style.type = "text/css";
        style.innerHTML = css;
        document.head.appendChild(style);
    };

    // add exception for pages /season/$/discussion/ for g4
    if (!/^\/serial\/.*\/season\/.*\/discussion\//.test(location.pathname)) {
        addGlobalStyle(`
            .page__wrapper--grid [data-group=g4].page__group,
            .page__wrapper--grid [data-group=g8].page__group {
                display: none !important;
            }
        `);
    }

    // add exception for g5 and hide section on /person/
    if (!/^\/person\//.test(location.pathname)) {
        addGlobalStyle(`
            .page__wrapper--grid [data-group=g5].page__group {
                display: none !important;
            }
        `);
    } else {
        addGlobalStyle(`
            .page__section.latestTrailerSection.LatestTrailerSection.hasMobileFa.section.isReady {
                display: none !important;
            }
        `);
    }

    addGlobalStyle(`
        .page__wrapper--grid [data-group=g9].page__group,
        .siteFooterSection,
        .page__wrapper--grid [data-group=g13].page__group {
            display: none !important;
        }
    `);
}