Artstation Show Mature Content

Show mature-content on artstation, without login.

질문, 리뷰하거나, 이 스크립트를 신고하세요.
// ==UserScript==
// @name         Artstation Show Mature Content
// @version      1.0.1
// @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        none
// @run-at       document-end
// @namespace Artstation
// ==/UserScript==

(function() {
    'use strict';

    var divs;
    var contentDiv;
    var matureContentDiv;
    var matureContentBlurDiv;
    var hasMatureContentDiv;

    var removeClassFromElements = function(elements, className) {
        elements.forEach(function(element) {
            if (element) {
                element.classList.remove(className);
            }
        });
    };

    var WhenLoadNew = function() {
        divs = document.getElementsByClassName("img-blur");
        divs = Array.from(divs);
        contentDiv = document.getElementsByClassName("mature-content-label");
        contentDiv = Array.from(contentDiv);
        matureContentDiv = document.getElementsByClassName("matureContent");
        matureContentDiv = Array.from(matureContentDiv);
        matureContentBlurDiv = document.getElementsByClassName("matureContent-blur");
        matureContentBlurDiv = Array.from(matureContentBlurDiv);
        hasMatureContentDiv = document.getElementsByClassName("has-matureContent");
        hasMatureContentDiv = Array.from(hasMatureContentDiv);

        removeClassFromElements(divs, 'img-blur');
        contentDiv.forEach(function(div) {
            if (div) {
                div.remove();
            }
        });
        removeClassFromElements(matureContentDiv, 'matureContent');
        removeClassFromElements(matureContentBlurDiv, 'matureContent-blur');
        removeClassFromElements(hasMatureContentDiv, 'has-matureContent');
    };

    window.addEventListener('load', function() {
        window.addEventListener('scroll', WhenLoadNew);
    }, false);

})();