Twitter - Auto Show Sensitive Content

Twitter Auto Show Sensitive Content. You Don't Have To Click "Show" Button Anymore When Reading NSFW Tweets With Blur Alert. 推特自动显示敏感的色情暴力内容,不再被模糊化。

目前为 2024-02-18 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Twitter - Auto Show Sensitive Content
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.5
  5. // @description Twitter Auto Show Sensitive Content. You Don't Have To Click "Show" Button Anymore When Reading NSFW Tweets With Blur Alert. 推特自动显示敏感的色情暴力内容,不再被模糊化。
  6. // @author Martin______X
  7. // @match https://twitter.com/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=twitter.com
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. const showNsfwDivClick = (async (showNsfwDiv)=>{
  14. showNsfwDiv.click();
  15. });
  16. const nfswClickInterval = setInterval(() => {
  17. //Counter
  18. let i = 0;
  19. //For Home & Profile--->Tweets
  20. let showNsfwDiv = document.getElementsByClassName("css-175oi2r r-sdzlij r-1phboty r-rs99b7 r-lrvibr r-173mn98 r-1s2bzr4 r-15ysp7h r-4wgw6l r-ymttw5 r-1loqt21 r-o7ynqc r-6416eg r-1ny4l3l");
  21. //For Profile--->Media
  22. let showNsfwDiv_2 = document.getElementsByClassName("css-1rynq56 r-bcqeeo r-qvutc0 r-37j5jr r-a023e6 r-rjixqe r-16dba41 r-1loqt21");
  23. //Annoying Button
  24. let hiddenItem = document.getElementsByClassName("css-175oi2r r-sdzlij r-1phboty r-rs99b7 r-lrvibr r-rki7wi r-e1k2in r-u8s1d r-15ysp7h r-4wgw6l r-ymttw5 r-1loqt21 r-o7ynqc r-6416eg r-1ny4l3l");
  25. //Attributes In Tabs
  26. let role = "";
  27. let tabindex = "";
  28. let dir = "";
  29.  
  30. //Click The Show Button On Home & Profile Tweets
  31. for(i=0;i<showNsfwDiv.length;i++){
  32. role = showNsfwDiv[i].getAttribute("role");
  33. tabindex = showNsfwDiv[i].getAttribute("tabindex");
  34. if(role == "button" & tabindex == "0"){
  35. showNsfwDivClick(showNsfwDiv[i]);
  36. }
  37. }
  38. //Click The Show Button On Media
  39. for(i=0;i<showNsfwDiv_2.length;i++){
  40. role = showNsfwDiv_2[i].getAttribute("role");
  41. dir = showNsfwDiv_2[i].getAttribute("dir");
  42. tabindex = showNsfwDiv_2[i].getAttribute("tabindex");
  43. if(role == "button" & dir == "ltr" & tabindex == "0"){
  44. showNsfwDivClick(showNsfwDiv_2[i]);
  45. }
  46. }
  47. //Hide The Buttons
  48. for(i=0;i<hiddenItem.length;i++){
  49. tabindex = hiddenItem[i].getAttribute("tabindex");
  50. if(tabindex == "0"){
  51. hiddenItem[i].style.display = 'none';
  52. }
  53. }
  54. }, 100);