『净网卫士』在线翻译

精简页面,移除广告,优化布局。适配:百度翻译、谷歌翻译、有道翻译、金山词霸、必应翻译、搜狗翻译、DeepL翻译。。

  1. // ==UserScript==
  2. // @name 『净网卫士』在线翻译
  3. // @name:zh-CN 『净网卫士』在线翻译
  4. // @namespace ttps://github.com/Hunlongyu
  5. // @version 0.2.1
  6. // @author Hunlongyu
  7. // @description Block ads on Baidu's translation interface, streamline pages, and optimize layout.
  8. // @description:zh-CN 精简页面,移除广告,优化布局。适配:百度翻译、谷歌翻译、有道翻译、金山词霸、必应翻译、搜狗翻译、DeepL翻译。。
  9. // @license MIT
  10. // @copyright Copyright (c) [2024] [hunlongyu]
  11. // @icon https://i.loli.net/2019/04/22/5cbd720718fdb.png
  12. // @homepageURL https://github.com/Hunlongyu/userscript
  13. // @supportURL https://github.com/Hunlongyu/userscript/issues
  14. // @match *://fanyi.baidu.com/*
  15. // @match *://www.iciba.com/translate
  16. // @match *://translate.google.com/*
  17. // @match *://fanyi.youdao.com/*
  18. // @match *://*.bing.com/translator*
  19. // @match *://fanyi.sogou.com/*
  20. // @match *://*.deepl.com/translator*
  21. // @match *://*.deepl.com/*
  22. // @grant GM_addStyle
  23. // @run-at document-start
  24. // ==/UserScript==
  25.  
  26. (function () {
  27. 'use strict';
  28.  
  29. var _GM_addStyle = /* @__PURE__ */ (() => typeof GM_addStyle != "undefined" ? GM_addStyle : void 0)();
  30. const sites = [
  31. {
  32. name: "baidu",
  33. css: `
  34. #header{display:none !important;}
  35. .trans-domain-btn{display: none !important;}
  36. .ai-trans-btn{display: none !important;}
  37. .manual-trans-btn{display: none !important;}
  38. .collection-btn{display: none !important;}
  39. .op-trans-fb{display: none !important;}
  40. #app-read{display: none !important;}
  41. .footer{display: none !important;}
  42. .note-expand-btn{display: none !important;}
  43. .trans-other-right{display: none;}
  44. .app-guide{display: none !important;}
  45. .desktop-guide-wrapper{display: none !important;}
  46. `
  47. },
  48. {
  49. name: "iciba",
  50. css: `
  51. nav{display: none !important;}
  52. [class^="translate_header"] ul:nth-child(2){display: none !important;}
  53. `
  54. },
  55. {
  56. name: "google",
  57. css: `
  58. .app-download-bar, #gb{display: none !important;}
  59. `
  60. },
  61. {
  62. name: "youdao",
  63. css: `
  64. .top, .banner, .footer, .sticky-sidebar{
  65. display:none !important;
  66. }
  67. .tab-header{
  68. display:none !important;
  69. }
  70. .index{
  71. background: url("") !important;
  72. }
  73. `
  74. },
  75. {
  76. name: "bing",
  77. css: `
  78. .desktop_header, .desktop_header_menu, #b_footer{display: none !important;}
  79. #tt_translatorHome{width: 96% !important;}
  80. `
  81. },
  82. {
  83. name: "sogou",
  84. css: `
  85. .translate-pc-header, .header-pc, .trans-type, .img-banner, .footer-pc{display: none !important;}
  86. .trans-box{margin-top: 20px;}
  87. `
  88. },
  89. {
  90. name: "deepl",
  91. css: `
  92. [data-testid="dl-footer"], [data-testid="write-promo-banner"], [data-testid="pro_ad_content"], [data-testid="app_banner_content"],
  93. [data-testid="dl-header"], aside, #cookieBanner{
  94. display: none !important;
  95. }
  96. `
  97. }
  98. ];
  99. const url = window.location.href;
  100. for (let i = 0; i < sites.length; i++) {
  101. if (url.includes(sites[i].name)) {
  102. _GM_addStyle(sites[i].css);
  103. break;
  104. }
  105. }
  106.  
  107. })();

QingJ © 2025

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