SankakuHairyBalls

Removes censorship from the balls of Gundam figmas.

当前为 2019-09-01 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name SankakuHairyBalls
// @description Removes censorship from the balls of Gundam figmas.
// @version 1
// @namespace Violentmonkey Scripts
// @match https://www.sankakucomplex.com/*
// @grant none
// ==/UserScript==

const CENSOR_CLASS = "censored";
const CENSOR_URL = "?then=";

// Removes the censor class from the images
var x = document.getElementsByClassName(CENSOR_CLASS);
for (var i = 0; i < x.length; i++) {
    x[i].classList.remove(CENSOR_CLASS);
}

// Removes the disclaimer page from the links
// example: https://www.sankakucomplex.com/mature-content-disclaimer/?then=
var xx = document.getElementsByTagName("A");
for (var i = 0; i < xx.length; i++) {    
    var href = xx[i].href;
    var j = href.indexOf(CENSOR_URL);
    if (j >= 0) {
        var link = href.substring(j + CENSOR_URL.length);
        link = decodeURIComponent(link); 
        //console.log(link);
        xx[i].href = link;
        
        // Click 'Yes' if we're in the disclaimer page
        var html = xx[i].innerHTML;
        if (html == "Yes, show me everything") {
            window.location.href = link;
            // alt
            //var evt = document.createEvent("HTMLEvents");
            //evt.initEvent("click", true, true);
            //xx[i].dispatchEvent(evt);
        }
    }
}