知乎上班摸鱼隐藏标题

主页、问题、专栏页面,隐藏标题logo 缩小标题字体

  1. // ==UserScript==
  2. // @name 知乎上班摸鱼隐藏标题
  3. // @namespace http://zhihu.com
  4. // @version 1.0
  5. // @description 主页、问题、专栏页面,隐藏标题logo 缩小标题字体
  6. // @author adi1625
  7. // @match https://*.zhihu.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function () {
  12. 'use strict'
  13.  
  14. // home page: hide logo and title
  15. var func = function() {
  16. // hide logo
  17. var logoes = document.getElementsByClassName('ZhihuLogoLink')
  18. for (var i = 0; i < logoes.length; i++) {
  19. logoes[i].style.display = 'none';
  20. }
  21.  
  22. // hide title
  23. var titleList = document.getElementsByClassName('ContentItem-title')
  24. for (var j = 0; j < titleList.length; j++) {
  25. titleList[j].style.fontSize = '14px';
  26. titleList[j].style.fontWeight = '200';
  27. }
  28. }
  29.  
  30. func();
  31.  
  32. // home page: hide when scroll
  33. window.onscroll = function () {
  34. func();
  35. }
  36.  
  37. // Home Page
  38. var mainColumn = document.getElementsByClassName('Topstory-mainColumn'); // main
  39. if (mainColumn[0]) mainColumn[0].style.width = '1000px';
  40.  
  41. var mainSidebar = document.getElementsByClassName('GlobalSideBar'); // sidebar
  42. if (mainSidebar[0]) mainSidebar[0].style.display = 'none';
  43.  
  44. // Question
  45. var qMainCol = document.getElementsByClassName('Question-mainColumn'); // main col
  46. if (qMainCol[0]) qMainCol[0].style.width = '1000px';
  47.  
  48. var qSidebar = document.getElementsByClassName('Question-sideColumn--sticky'); // sidebar
  49. if (qSidebar[0]) qSidebar[0].style.display = 'none';
  50.  
  51. var qTitles = document.getElementsByClassName('QuestionHeader-title'); // title
  52. if (qTitles[0]) qTitles[0].innerHTML = '';
  53. if (qTitles[1]) qTitles[1].innerHTML = '';
  54.  
  55. // post
  56. var postTitle = document.getElementsByClassName('Post-Title'); // Post title
  57. if (postTitle[0]) postTitle[0].style.fontSize = '14px';
  58.  
  59. // page title
  60. var tags = document.getElementsByTagName('title'); // title
  61. if (tags[0]) tags[0].innerHTML = '新建文本文档';
  62.  
  63. })()

QingJ © 2025

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