TvTroper

Blocking ads and popup on TvTropes.org

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name     TvTroper
// @namespace tvtroper_1773095933
// @version  1.2
// @grant    none
// @author 	 LuaMaria (GreasyFork Version)
// @include	 *://tvtropes.org/*
// @description Blocking ads and popup on TvTropes.org
// @run-at 	 document-end
// @icon		https://assets.tvtropes.org/img/icons/apple-icon-180x180.png
// @license   LGPL-3.0-or-later
// ==/UserScript==

/*
  This program is free software: 
  you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, 
  either version 3 of the License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful, 
  but WITHOUT ANY WARRANTY; 
  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 

  See the GNU Lesser General Public License for more details.
  < https://www.gnu.org/licenses/lgpl-3.0.html >. 
*/


//Last Update = March 18, 2026

'use strict';

const init = '##TVTroper is Active!';
console.warn(init);
//alert(init);

function id(str){
    return document.getElementById(str);
}

function sa(str){
    return document.querySelectorAll(str); 
}

const old_content = id('main-entry');

console.clear();

function blast(){
    //remove that pesky anti ad-block
    setTimeout( function(){
	console.clear();
	console.warn('restored', old_content);
	id('main-entry').innerHTML = old_content.innerHTML;
    }, 1000);

    //remove that sidebar ad
    id('stick-cont').remove();
    const sidebar_ad_class = '.tvtropes-ad-unit';
    const cursed_ad = sa(sidebar_ad_class);
    cursed_ad.forEach( s => {
	alert(s);
	console.log(s);
	s.style.display = 'none';
    });
}

blast();
let checking_counter = 0;
let checking_max_retries = 10;
const keep_checking = setInterval( function(){
    const anti_adblock = document.getElementById('adblock_title');
    if(anti_adblock){
	console.warn('they block you');
	blast();
	return;
    }else{
   	console.warn('you bypassed it hehe');
    }
    
    checking_counter ++;
    if(checking_counter > checking_max_retries){
	console.clear();
   	clearInterval(keep_checking);
	console.warn("Unblocking is done!");
    }
}, 1000);