Hide Twitter Views link

Remove the twitter views link from people's tweets

当前为 2022-12-23 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Hide Twitter Views link
  3. // @namespace https://twitter.com/14letterhandle
  4. // @version 0.2
  5. // @description Remove the twitter views link from people's tweets
  6. // @author 14letterhandle
  7. // @match https://twitter.com/*
  8. // @icon https://static.thenounproject.com/png/1159224-200.png
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. const isViewsButton = (tweetLink) =>
  13. tweetLink.href.endsWith("/analytics") &&
  14. !tweetLink.innerHTML.includes("View Tweet analytics");
  15.  
  16. (function () {
  17. "use strict";
  18.  
  19. const removeViews = () =>
  20. Array.from(document.querySelectorAll("article"))
  21. .flatMap((tweet) => Array.from(tweet.querySelectorAll("a")))
  22. .filter(isViewsButton)
  23. .forEach((tweetLink) => {
  24. tweetLink.remove();
  25. });
  26.  
  27. setInterval(removeViews, 100);
  28. })();

QingJ © 2025

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