Artstation Show Mature Content

Show mature-content on Artstation without login.

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

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

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         Artstation Show Mature Content
// @version      1.1.3
// @description  Show mature-content on Artstation without login.
// @author       Wizzergod
// @match        https://www.artstation.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=artstation.com
// @license      MIT
// @grant        GM_download
// @grant        GM_xmlhttpRequest
// @grant        GM_info
// @grant        GM_addStyle
// @grant        GM_registerMenuCommand
// @grant        GM.xmlHttpRequest
// @grant        GM.getResourceUrl
// @grant        GM.openInTab
// @grant        GM_setValue
// @grant        GM_getValue
// @grant        unsafeWindow
// @grant        GM_openInTab
// @grant        GM_notification
// @run-at       document-idle
// @connect      www.artstation.com
// @connect      artstation.com
// @namespace    Artstation
// ==/UserScript==

(function () {
    'use strict';

    // Helper function to remove classes from elements
    const removeClassFromElements = (elements, className) => {
        elements.forEach((element) => {
            if (element) {
                element.classList.remove(className);
            }
        });
    };

    // Main function to process and unblur mature content
    const processMatureContent = () => {
        const elementsToRemoveClasses = [
            { className: 'img-blur', elements: document.getElementsByClassName('img-blur') },
            { className: 'mature-content', elements: document.getElementsByClassName('mature-content') },
            { className: 'matureContent', elements: document.getElementsByClassName('matureContent') },
            { className: 'matureContent-blur', elements: document.getElementsByClassName('matureContent-blur') },
            { className: 'has-matureContent', elements: document.getElementsByClassName('has-matureContent') },
            { className: 'matureContent-container', elements: document.getElementsByClassName('matureContent-container') },
        ];

        // Remove unwanted classes
        elementsToRemoveClasses.forEach(({ className, elements }) => {
            removeClassFromElements(Array.from(elements), className);
        });

        // Remove specific elements
        Array.from(document.getElementsByClassName('mature-content-label')).forEach((div) => div?.remove());
    };

    // Add event listeners for processing on load and scroll
    window.addEventListener('load', () => {
        processMatureContent();
        window.addEventListener('scroll', processMatureContent);
    });

    // GM_addStyle
    GM_addStyle(`
        .matureContent-container, .mature-content, .img-blur, .mature-content-label,
        div.mature-content-label, .matureContent, .matureContent-blur, .has-matureContent {
            display: none !important;
        }
    `);
})();