您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Support 2019 new UI Twitter only.
当前为
// ==UserScript== // @name Twitter - Hide Retweet // @version 1.0.0 // @description Support 2019 new UI Twitter only. // @author Hayao-Gai // @namespace https://github.com/HayaoGai // @icon https://i.imgur.com/M9oO8K9.png // @include https://twitter.com/* // @require http://code.jquery.com/jquery-3.4.1.slim.min.js // @grant none // ==/UserScript== (function() { 'use strict'; const $ = window.jQuery; // 觀察文件是否產生變化 waitLoaded(); //等待文件讀取 const MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; //前綴 function waitLoaded() { const section = document.getElementsByTagName("section"); setTimeout(() => { if (section.length !== 2) waitLoaded(); else { const target = section[0].children[1].children[0].children[0]; //取出會產生變化的節點 hideRetweet(); const observer = new MutationObserver(e => { //建立觀察者,文件有變化就執行下列函式 hideRetweet(); }); const config = { attributes: true, childList: true, characterData: true }; //設定觀察選項 observer.observe(target, config); //開始觀察 } }, 500); } function hideRetweet() { // 已轉推 $(".css-1dbjc4n.r-d0pm55").each((i, retweet) => { // 父物件 $(retweet).parents().each((j, parent) => { let check = false; //確認推文是否已隱藏 // 最上層 $(parent).each((k, hide) => { if ($(hide).hasClass("")) { $(hide).hide(); check = true; return false; } }); if (check) return false; }); }); } })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址