Twitter Blue Block

Block all tweets with blue tick on Twitter home page (timeline) and search results page (latest tab) on desktop browsers (Chrome, Firefox, Edge, Safari, Opera, Brave, etc)

  1. // ==UserScript==
  2. // @name Twitter Blue Block
  3. // @namespace https://github.com/aetherwu/BlockTwitterBlue
  4. // @version 0.1
  5. // @description Block all tweets with blue tick on Twitter home page (timeline) and search results page (latest tab) on desktop browsers (Chrome, Firefox, Edge, Safari, Opera, Brave, etc)
  6. // @author Aether
  7. // @match https://twitter.com/home
  8. // @match https://twitter.com/*
  9. // @match https://mobile.twitter.com/*
  10. // @icon https://www.google.com/s2/favicons?sz=64&domain=twitter.com
  11. // @grant none
  12. // @license MIT
  13. // ==/UserScript==
  14.  
  15. function hideVerifiedTweets() {
  16. let verifiedIcons = document.querySelectorAll('svg[data-testid="icon-verified"]:not([data-processed="true"])');
  17. verifiedIcons.forEach((icon, index) => {
  18. console.log(index)
  19. let parentElement = icon.parentElement;
  20.  
  21. // Loop to find the ancestor with data-testid="cellInnerDiv"
  22. while(parentElement && parentElement.getAttribute('data-testid') !== 'cellInnerDiv') {
  23. parentElement = parentElement.parentElement;
  24. }
  25.  
  26. // If found, hide this ancestor
  27. if(parentElement && parentElement.getAttribute('data-testid') === 'cellInnerDiv') {
  28. parentElement.style.display = 'none';
  29. console.log(`Hid the parent div of verified icon at index ${index}`);
  30. }
  31.  
  32. // Mark as processed
  33. icon.setAttribute('data-processed', 'true');
  34. });
  35.  
  36. if(verifiedIcons.length === 0) {
  37. console.log('No verified icons found');
  38. }
  39. }
  40.  
  41. (function() {
  42. 'use strict';
  43.  
  44. // Your code here...
  45. // Call the function
  46. setInterval(hideVerifiedTweets, 300)
  47. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址