您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Hides ad placeholders and empty ads on The Indian Express and The Hindu
// ==UserScript== // @name Element Hider for The Indian Express and The Hindu // @namespace http://greasyfork.org/ // @version 0.8 // @description Hides ad placeholders and empty ads on The Indian Express and The Hindu // @author Todo Pertin // @match https://indianexpress.com/* // @match https://www.thehindu.com/* // @license GNU GPLv3 // @grant none // ==/UserScript== (function() { 'use strict'; // Add the class names and ID of elements you want to hide in the arrays below const elementsToHide = [ 'osv-ad-class', 'ie-int-campign-ad', 'adboxtop', 'add-first', 'OMIDYAR_HOME_EVENTS' ]; const idsToHide = [ 'articledivrec' ]; function hideElements() { // Hide elements by class name elementsToHide.forEach(className => { const elements = document.getElementsByClassName(className); for (const element of elements) { element.style.display = 'none'; } }); // Hide elements by ID idsToHide.forEach(id => { const element = document.getElementById(id); if (element) { element.style.display = 'none'; } }); } // Run the function when the DOM is ready if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', hideElements); } else { hideElements(); } })();