Remove Twitter Promote Button

Removes the "Promote" button on Twitter

  1. // ==UserScript==
  2. // @name Remove Twitter Promote Button
  3. // @namespace http://voilentmonkey.net/
  4. // @version 0.1
  5. // @description Removes the "Promote" button on Twitter
  6. // @author Razor7100 on Github
  7. // @match https://twitter.com/*
  8. // @grant none
  9. // ==/UserScript==
  10. function deleteButtons() {
  11. const buttons = document.querySelectorAll('.css-4rbku5.css-18t94o4.css-1dbjc4n.r-1niwhzg.r-sdzlij.r-1phboty.r-rs99b7.r-1loqt21.r-1s2bzr4.r-2yi16.r-1qi8awa.r-1ny4l3l.r-ymttw5.r-o7ynqc.r-6416eg.r-lrvibr');
  12.  
  13. buttons.forEach(button => {
  14. button.remove();
  15. });
  16. }
  17.  
  18. // Attach the MutationObserver when the page is finished loading
  19. window.addEventListener('load', () => {
  20. // Select the node that will be observed for mutations
  21. const targetNode = document.body;
  22.  
  23. // Options for the observer (which mutations to observe)
  24. const config = { attributes: false, childList: true, subtree: true };
  25.  
  26. // Create an observer instance linked to the callback function
  27. const observer = new MutationObserver((mutationsList, observer) => {
  28. deleteButtons();
  29. });
  30.  
  31. // Start observing the target node for configured mutations
  32. observer.observe(targetNode, config);
  33.  
  34. // Delete any buttons that are already in the DOM
  35. deleteButtons();
  36. });

QingJ © 2025

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