您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Removes the Views counter & Analytics icon from tweets.
// ==UserScript== // @name Fix Elon's Folly // @namespace http://tampermonkey.net/ // @version 0.4 // @description Removes the Views counter & Analytics icon from tweets. // @author ThriceGreatAlex // @match *://twitter.com/* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; const callback = function(mutationsList, observer) { for (let mutation of mutationsList) { const views = Array.from( document.body.querySelectorAll('span') ).filter( x => { var y = x.textContent.toLowerCase() return y.startsWith('view') && !y.startsWith('view ') } ); views.forEach( x => x.parentElement.parentElement.parentElement.remove() ); const analytics = Array.from( document.body.querySelectorAll( "path[d='M8.75 21V3h2v18h-2zM18 21V8.5h2V21h-2zM4 21l.004-10h2L6 21H4zm9.248 0v-7h2v7h-2z']" ) ) analytics.forEach( x => { var y = x.parentElement.parentElement.parentElement.parentElement if (y.textContent.toLowerCase() !== 'view tweet analytics') { y.parentElement.parentElement.remove() } } ) } } const observer = new MutationObserver(callback); observer.observe( document.querySelector('body'), { attributes: true, childList: true, subtree: true } ); })();