Fuck ZhiHu Mobile Style

日他娘的逼乎手机网页版 样式ver; 针对电脑版进行修改,适配手机屏幕;

目前為 2018-11-28 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Fuck ZhiHu Mobile Style
  3. // @namespace https://github.com/ipcjs
  4. // @version 2.0.2
  5. // @description 日他娘的逼乎手机网页版 样式ver; 针对电脑版进行修改,适配手机屏幕;
  6. // @author ipcjs
  7. // @include https://www.zhihu.com/*
  8. // @include https://zhuanlan.zhihu.com/*
  9. // @require https://gf.qytechs.cn/scripts/373283-ipcjs-lib-js/code/ipcjslibjs.js?version=647820
  10. // @grant GM_addStyle
  11. // ==/UserScript==
  12.  
  13. GM_addStyle(`
  14. /* Header */
  15. .AppHeader {
  16. min-width: inherit;
  17. }
  18. .AppHeader-inner {
  19. width: 100%;
  20. }
  21. .SearchBar {
  22. display: none;
  23. }
  24. .AppHeader-messages, .AppHeader-notifications {
  25. margin-right: 16px;
  26. }
  27. .AppHeader-userInfo {
  28. margin-right: 32px;
  29. }
  30. .AppHeader-navItem {
  31. padding: 0 5px;
  32. }
  33. .AppHeader-nav {
  34. margin-left: 16px;
  35. margin-right: 16px;
  36. }
  37. .TopstoryPageHeader-main {
  38. margin-left: 16px;
  39. }
  40.  
  41. /* 通用列表 */
  42. .Topstory-container, .Question-main, .Profile-main {
  43. display: block;
  44. width: 100%;
  45. padding: 0px;
  46. }
  47. .Topstory-mainColumn, .Question-mainColumn, .Profile-mainColumn {
  48. width: 100%;
  49. }
  50. .Question-sideColumn, .Profile-sideColumn {
  51. width: 100%;
  52. }
  53.  
  54. /* 回答页面的Header */
  55. .QuestionHeader .QuestionHeader-content {
  56. width: 100%;
  57. display: block;
  58. padding: 0px;
  59. }
  60. .QuestionHeader .QuestionHeader-main {
  61. width: 100%;
  62. }
  63. .QuestionHeader .QuestionHeader-side {
  64. width: 100%;
  65. }
  66. .QuestionHeader .NumberBoard {
  67. margin: auto;
  68. }
  69. .QuestionHeader {
  70. min-width: inherit;
  71. }
  72. .PageHeader .QuestionHeader-content {
  73. width: 100%;
  74. }
  75. .PageHeader .QuestionHeader-main {
  76. width: 100%;
  77. padding: 0px;
  78. }
  79. .PageHeader .QuestionHeader-side {
  80. display: none;
  81. }
  82.  
  83. /* 个人主页的Header */
  84. .ProfileHeader {
  85. width: 100%;
  86. padding: 0px;
  87. }
  88.  
  89. /* 列表Item上的按钮 */
  90. .ShareMenu {
  91. display: none;
  92. }
  93. .ContentItem-action {
  94. margin-left: 8px;
  95. }
  96.  
  97. /* 专栏页面 */
  98. .Post-NormalMain .Post-Header, .Post-NormalMain>div {
  99. width: 100%;
  100. }
  101. .ColumnPageHeader-content {
  102. width: 100%;
  103. }
  104. `)
  105.  
  106. ipcjs.installInto(({ log, html, $ }) => {
  107. log = GM_info.script.name.endsWith('.dev') ? log : () => { }
  108. removeThankButton(document)
  109. new MutationObserver((mutations, observer) => {
  110. // log(mutations)
  111. for (let m of mutations) {
  112. for (let node of m.addedNodes) {
  113. if (node.nodeType === Node.ELEMENT_NODE) {
  114. removeThankButton(node)
  115. }
  116. }
  117. }
  118. }).observe(document.body, {
  119. childList: true,
  120. subtree: true
  121. })
  122. function removeThankButton(node) {
  123. let count = 0
  124. node.querySelectorAll('button.ContentItem-action')
  125. .forEach(btn => {
  126. if (btn.innerText.includes('感谢')) {
  127. btn.style.display = 'none'
  128. count++
  129. }
  130. })
  131. if (count > 0) {
  132. log(`remove: ${count}`)
  133. }
  134. }
  135. })

QingJ © 2025

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