Hide Tesla/Musk/Green Deals & Featured Section

Hide any article (standard or featured) tagged Tesla, Elon Musk, or Green Deals, and remove the Featured carousel section

Stan na 24-04-2025. Zobacz najnowsza wersja.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Hide Tesla/Musk/Green Deals & Featured Section
// @description  Hide any article (standard or featured) tagged Tesla, Elon Musk, or Green Deals, and remove the Featured carousel section
// @match        https://electrek.co/*
// @version 0.0.1.20250424083126
// @namespace https://greasyfork.org/users/1435046
// ==/UserScript==

(function() {
    const style = document.createElement('style');
    style.textContent = `
        /* Hide any <article> (standard or featured) tagged Tesla, Elon Musk, or Green Deals */
        article.article:has(ul.article__meta-guides a[href*="/tesla/"]),
        article.article:has(ul.article__meta-guides a[href*="/elon-musk/"]),
        article.article:has(ul.article__meta-guides a[href*="/green-deals/"]) {
            display: none !important;
        }

        /* Remove the entire Featured section (container with an <h2 attr-title="Featured">) */
        div.container.xs:has(> h2[attr-title="Featured"]) {
            display: none !important;
        }
    `;
    document.head.appendChild(style);
})();