Tinychat Cleanup

9.2.2017 After stylebot (http://stylebot.me/styles/10932) + ABP, remove the other spam.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Tinychat Cleanup
// @namespace    http://www.JamesKoss.com/
// @version      1.1
// @description  9.2.2017 After stylebot (http://stylebot.me/styles/10932) + ABP, remove the other spam.
// @author       James Koss
// @match        https://tinychat.com/*
// ==/UserScript==

(function() {
    'use strict';
    
    var el1 = document.querySelectorAll('div[id^="div-gpt-ad-"]')[0];
    el1.parentNode.removeChild(el1);
    var el2 = document.querySelectorAll('script[src="/public/js/ads.js"]')[0];
    el2.parentNode.removeChild(el2);
    var el3 = document.querySelectorAll('script');
    for (var x in el3) {
        var y = el3[x];
        if (y.outerHTML) {
            // All scripts to be removed.
            if (y.outerHTML.indexOf('function checkAds') !== -1 ||
                y.outerHTML.indexOf('_cc7034') !== -1 ||
                y.outerHTML.indexOf('crwdcntrl') !== -1 ||
                y.outerHTML.indexOf('googleads') !== -1 ||
                y.outerHTML.indexOf('adnxs') !== -1) {
                y.parentNode.removeChild(y);
            }
        }
    }
    var el4 = document.querySelectorAll('iframe[id="iframe_ad"]')[0];
    el4.parentNode.removeChild(el4);
})();