您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Remove ad "tweets" in feed.
当前为
// ==UserScript== // @name TwitterRemoveAds // @version 1.0.0 // @description Remove ad "tweets" in feed. // @author shellster // @match *://twitter.com/* // @run-at document-start // @grant unsafeWindow // @namespace https://gf.qytechs.cn/en/users/316827 // @license GNU General Public License v3.0 or later // @compatible chrome 90 // ==/UserScript== "use strict"; (function () { /** * @type {Window & typeof globalThis} doc */ const win = unsafeWindow; /** * @type {Document} doc */ const doc = win.document; const MutationObserver = win.MutationObserver; /** * @argument {string} selector * @returns {HTMLElement | null} element */ const $ = (selector) => doc.querySelector(selector); /** * @argument {string} selector * @returns {NodeListOf<HTMLElement> | null} element */ const $$ = (selector) => doc.querySelectorAll(selector); function XPathResult(xpath) { let return_array = [] let nodes = document.evaluate(xpath, document, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null); let node = nodes.iterateNext(); while (node) { return_array.push(node) node = nodes.iterateNext(); } return return_array } // let blockBlockAdBlockFlag = false; function removeAd() { Array.from(XPathResult("//*[text() = 'Ad']/ancestor::*[self::article]")).forEach((that) => { that.style.display="none"; }); } document.addEventListener("DOMContentLoaded", () => { const observer = new MutationObserver(removeAd); observer.observe(doc.body, { attributes: true, childList: true, subtree: true }); removeAd(); }); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址