Anonymous Zhihu

我只想专心看答案,不想知道你是谁。

  1. // ==UserScript==
  2. // @name Anonymous Zhihu
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.3
  5. // @description 我只想专心看答案,不想知道你是谁。
  6. // @author You
  7. // @match https://www.zhihu.com/*
  8. // @grant none
  9. // @require https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js
  10. // @require https://gf.qytechs.cn/scripts/31940-waitforkeyelements/code/waitForKeyElements.js?version=209282
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. // TODO:
  17. // 去掉鼠标悬浮时用户信息的加载
  18.  
  19. // Your code here...
  20. var hiddenClassNames = [
  21. // index page
  22. 'Voters',
  23. 'ContentItem-actions',
  24. 'Question-sideColumn',
  25. 'GlobalSideBar-categoryList',
  26.  
  27. // feed page
  28. 'author-info',
  29. 'zm-side-section-inner',
  30. 'zm-item-answer-author-info',
  31. 'zm-item-link-avatar',
  32. 'zm-item-vote-info',
  33. ];
  34.  
  35. var mentionClassNames = [
  36. 'member_mention',
  37. ];
  38.  
  39. var anonymousAvatar = 'https://pic1.zhimg.com/aadd7b895_xs.jpg';
  40.  
  41. waitForKeyElements('.AuthorInfo-avatar', function(elem){
  42. elem.attr('src', anonymousAvatar,);
  43. elem.attr('srcset', anonymousAvatar);
  44. });
  45.  
  46. waitForKeyElements('.AuthorInfo-head', function(elem) {
  47. elem.text('小明');
  48. });
  49.  
  50. waitForKeyElements('.AuthorInfo-detail', function(elem) {
  51. elem.empty();
  52. });
  53.  
  54. waitForKeyElements('.UserLink-link', function(elem) {
  55. var text = elem.text();
  56. elem.attr('href', '#');
  57. if(text[0] == '@') {
  58. elem.text('@小明');
  59. elem.attr('href', '#');
  60. }
  61. });
  62.  
  63. hiddenClassNames.forEach(function(name) {
  64. waitForKeyElements('.'+name, function(elem) {
  65. elem.css('display', 'none');
  66. });
  67. });
  68.  
  69. mentionClassNames.forEach(function(name) {
  70. waitForKeyElements('.'+name, function(elem) {
  71. elem.text('@小明');
  72. elem.attr('href', '#');
  73. });
  74. });
  75. })();

QingJ © 2025

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