Twitter Auto Show NSFW

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

目前为 2024-01-21 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Twitter Auto Show NSFW
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.2
  5. // @description Twitter Auto Show NSFW, You Don't Have To Click "Show" Button Anymore When Reading NSFW Tweets With Blur Alert. 推特自动显示色情暴力内容,自动显示NSFW内容,不再被模糊化。
  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. async function showNsfwDivClick(showNsfwDiv) {
  14. showNsfwDiv.click();
  15. }
  16.  
  17. const nfswClickInterval = setInterval(() => {
  18.  
  19. //For Home & Profile--->Tweets
  20. var 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. var showNsfwDiv_2 = document.getElementsByClassName("css-1rynq56 r-bcqeeo r-qvutc0 r-37j5jr r-a023e6 r-rjixqe r-16dba41 r-1loqt21");
  23. //Annoying Button
  24. var 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.  
  26. //
  27. for(var i=0;i<showNsfwDiv.length;i++){
  28. var attr_role_1 = showNsfwDiv[i].getAttribute("role");
  29. var attr_tableindex_1 = showNsfwDiv[i].getAttribute("tabindex");
  30. if(attr_role_1 == "button" & attr_tableindex_1 == "0"){
  31. showNsfwDivClick(showNsfwDiv[i]);
  32. }
  33. }
  34. //
  35. for(i=0;i<showNsfwDiv_2.length;i++){
  36. var attr_role_2 = showNsfwDiv_2[i].getAttribute("role");
  37. var attr_dir = showNsfwDiv_2[i].getAttribute("dir");
  38. var attr_tableindex_2 = showNsfwDiv_2[i].getAttribute("tabindex");
  39. if(attr_role_2 == "button" & attr_dir == "ltr" & attr_tableindex_2 == "0"){
  40. showNsfwDivClick(showNsfwDiv_2[i]);
  41. }
  42. }
  43. //
  44. for(i=0;i<hiddenItem.length;i++){
  45. var attr_tableindex_3 = hiddenItem[i].getAttribute("tabindex");
  46. if(attr_tableindex_3 == "0"){
  47. hiddenItem[i].style.display = 'none';
  48. }
  49. }
  50. }, 100);