网页屏蔽优化

对部分网站进行广告屏蔽与布局优化使其更顺眼

Per 08-04-2024. Zie de nieuwste versie.

  1. // ==UserScript==
  2. // @name 网页屏蔽优化
  3. // @namespace Violentmonkey Scripts
  4. // @match https://www.toutiao.com/*
  5. // @match https://*.justeasy.cn/*
  6. // @match https://fanyi.baidu.com/*
  7. // @match https://www.bimiacg4.net/bangumi/*
  8. // @match https://www.bimiacg5.net/bangumi/*
  9. // @match https://hanime1.me/comic/*
  10. // @match https://www.hanjukankan.com/movie/*
  11. // @match https://www.thanju.com/detail/*
  12. // @match https://greasyfork.org/zh-CN/scripts*
  13. // @match https://sleazyfork.org/zh-CN/scripts*
  14. // @grant none
  15. // @version 0.0.41
  16. // @author YeSilin
  17. // @license GPL-3.0-or-later
  18. // @grant GM_addStyle
  19. // @description 对部分网站进行广告屏蔽与布局优化使其更顺眼
  20. // ==/UserScript==
  21.  
  22.  
  23.  
  24.  
  25. (function () {
  26. 'use strict';
  27.  
  28.  
  29. // 今日头条优化
  30. if (window.location.host === "www.toutiao.com") {
  31.  
  32. // 屏蔽今日头条置顶文章
  33. let css = `
  34. .feed-card-wrapper.feed-card-article-wrapper.sticky-cell{
  35. display: none;
  36. }`
  37. GM_addStyle(css)
  38.  
  39. // 修复今日头条个人主页兼容 DarkReader
  40. if (window.location.href.indexOf("https://www.toutiao.com/c/user/token/") > -1) {
  41. // 删掉默认的白色背景
  42. // document.getElementsByClassName('profile-container')[0].style.background = "none";
  43. document.querySelector(".profile-container").style.background = "none";
  44. // 修改搜索框的背景颜色,即使改了也会被 DarkReader 修改成其他值以符合他的主题
  45. document.querySelector(".search>input").style.backgroundColor = "#eee";
  46.  
  47. }
  48. return
  49. }
  50.  
  51.  
  52.  
  53. // 建E网优化
  54. if (window.location.host === "www.justeasy.cn") {
  55. let css = `
  56. /* 屏蔽开工广告 */
  57. .kiagong_big_flex{
  58. display: none !important;
  59. }
  60. .kiagong_small_flex{
  61. display: none !important;
  62. }
  63.  
  64. /* 屏蔽搜索栏广告 */
  65. .shuangjie{
  66. display: none !important;
  67. }
  68. /* 屏蔽右侧悬浮广告 */
  69. #recharge_vip_flex{
  70. display: none !important;
  71. }
  72.  
  73. /* 屏蔽详情页广告 */
  74. .newModel_reach{
  75. display: none !important;
  76. } `
  77. GM_addStyle(css)
  78. return
  79. }
  80.  
  81.  
  82. // 百度翻译优化
  83. if (window.location.host === "fanyi.baidu.com") {
  84. let css = ""
  85. // 如果是新版
  86. if (window.location.href.indexOf("https://fanyi.baidu.com/mtpe-individual/") > -1) {
  87. css = `
  88. /* 屏蔽右侧广告 */
  89. .UMjeGiEI {
  90. display: none !important;
  91. }
  92. /* 屏蔽顶部开通会员广告 */
  93. .URCZyDIb {
  94. display: none !important;
  95. }
  96. /* 屏蔽页尾广告 */
  97. .jIoZrIPe {
  98. display: none !important;
  99. }
  100.  
  101. `
  102.  
  103. } else {
  104.  
  105. css = `
  106. /* 屏蔽左侧广告 */
  107. #app-read{
  108. display: none !important;
  109. }
  110. /* 屏蔽右侧广告 */
  111. #sideBannerContainer{
  112. display: none !important;
  113. }
  114. /* 屏蔽人工翻译按钮 */
  115. .manual-trans-btn{
  116. display: none !important;
  117. }
  118. /* 屏蔽ai翻译按钮 */
  119. .ai-trans-btn{
  120. display: none !important;
  121. }
  122.  
  123. /* 屏蔽页尾联系我们 */
  124. .follow-wrapper {
  125. display: none !important;
  126. }
  127. /* 减小左边距与屏蔽左侧导航 */
  128. @media(max-width: 1253px) {
  129. .container .inner {
  130. margin: 0 25px;
  131. }
  132. #side-nav .nav-ol {
  133. display: none !important;
  134. }
  135. }
  136. `;
  137.  
  138.  
  139. // 屏蔽顶部开通会员广告
  140. document.querySelector("#nav_bar_vip_btn").remove()
  141.  
  142. // 屏蔽右侧意见反馈
  143. document.querySelector("#index-feedback-btn").style.visibility = "hidden"
  144.  
  145. // 屏蔽右侧APP下载推荐
  146. document.querySelector(".sideQrContainer").style.visibility = "hidden"
  147.  
  148. // 屏蔽页尾产品展示
  149. document.querySelector("#footer-products-container").remove()
  150.  
  151. }
  152.  
  153. GM_addStyle(css)
  154. return
  155. }
  156.  
  157.  
  158.  
  159.  
  160. // 哔咪动漫优化
  161. if (window.location.host === "www.bimiacg4.net" || window.location.host === "www.bimiacg5.net") {
  162.  
  163. // 显示完整的剧情介绍
  164. if (window.location.pathname.indexOf("/bangumi/bi/") > -1) {
  165. let synopsis = document.querySelector("#synopsis_txt+p")
  166. let jianjie = document.querySelector(".vod-jianjie>p")
  167. if (synopsis.innerText != jianjie.innerText) {
  168. synopsis.innerText = jianjie.innerText
  169. }
  170. return
  171. }
  172.  
  173. let css = `
  174. /* 屏蔽移动字幕广告 */
  175. body > section > div.main > marquee{
  176. display: none !important;
  177. }`
  178. GM_addStyle(css)
  179.  
  180. // 自动跳过推荐下载安卓客户端
  181. // document.querySelector("#video>div>div>p>a").click()
  182. $("#bkcl").remove();
  183.  
  184. return
  185. }
  186.  
  187.  
  188. // Hanime1 优化
  189. if (window.location.href.indexOf("https://hanime1.me/comic/") > -1) {
  190.  
  191. let css = `
  192. /*删除漫画广告*/
  193. .comics-banner-ads {
  194. display: none !important;
  195. }
  196. /*漫画显示原始大小*/
  197. #current-page-image {
  198. max-height: 100%;
  199. }`
  200. GM_addStyle(css)
  201.  
  202. }
  203.  
  204.  
  205.  
  206. // 韩剧看看优化
  207. if (window.location.href.indexOf("https://www.hanjukankan.com/movie/") > -1) {
  208. // 优化简介直接显示完整的剧情介绍
  209. document.querySelector(".sketch.hidden-sm.hidden-xs").innerHTML = document.querySelector("#jq .myui-panel_bd").innerHTML
  210. return
  211. }
  212.  
  213.  
  214.  
  215. // 看韩剧优化
  216. if (window.location.href.indexOf("https://www.thanju.com/detail/") > -1) {
  217. // 优化简介直接显示完整的剧情介绍
  218. document.querySelector(".desc.hidden-xs").innerHTML = `\<span class="left text-muted">简介:</span>` + document.querySelector(".sketch.content").innerText.replace("剧情:", "")
  219. return
  220. }
  221.  
  222.  
  223.  
  224. // GreasyFork 优化
  225. if (document.URL.indexOf("https://greasyfork.org/zh-CN/scripts") > -1 || document.URL.indexOf("https://sleazyfork.org/zh-CN/scripts") > -1) {
  226. // 优化脚本列表中链接以新标签方式打开
  227. document.querySelectorAll("#browse-script-list > li > article > h2 > a").forEach((element) => {
  228. element.target = "_blank"
  229. })
  230. document.querySelectorAll("#browse-script-list > li > article > div > dl > dd.script-list-author > span > a").forEach((element) => {
  231. element.target = "_blank"
  232. })
  233. return
  234. }
  235.  
  236. })();
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.