吾爱破解自动切换宽窄版(去广告)

吾爱破解(www.52pojie.cn)自动切换窄版,去除广告

  1. // ==UserScript==
  2. // @name 吾爱破解自动切换宽窄版(去广告)
  3. // @icon https://www.52pojie.cn/favicon.ico
  4. // @namespace http://tampermonkey.net/
  5. // @version 1.2
  6. // @description 吾爱破解(www.52pojie.cn)自动切换窄版,去除广告
  7. // @author The_Soloist
  8. // @match https://www.52pojie.cn/*
  9. // @grant GM_addStyle
  10. // ==/UserScript==
  11.  
  12. (function () {
  13. 'use strict';
  14.  
  15. const css = `
  16. /* 帖内广告:水平 + 竖直 */
  17. .dnch_eo_pt, .dnch_eo_pr{ display: none !important; }
  18.  
  19. /* 用户签名 + 签名下的提示 */
  20. .sign, .dnch_eo_pb{ display: none !important; }
  21.  
  22. /* 底部广告 */
  23. .dnch_eo_f, .dnch_eo_mu{ display: none !important; }
  24. `
  25.  
  26. // css去除广告
  27. try {
  28. GM_addStyle(css)
  29. } catch (e) {
  30. console.log('脚本失效,刷新后重试。', e)
  31. }
  32.  
  33. // 模拟点击
  34. var url = document.URL;
  35. var switch_width_title = document.getElementById('switchwidth').getAttribute("title");
  36. if (url == 'https://www.52pojie.cn/' || url.indexOf('forum-') != -1 || url.indexOf('forum.php') != -1 || url.indexOf('misc.php') != -1 || url.indexOf('home.php') != -1) {
  37. if (switch_width_title == "切换到窄版") { // 网站目录等 切换到窄版
  38. document.getElementById("switchwidth").click();
  39. }
  40. }
  41. if (url.indexOf('thread-') != -1) {
  42. if (switch_width_title == "切换到宽版") { // 帖子等 切换到宽版
  43. document.getElementById("switchwidth").click();
  44. }
  45. }
  46.  
  47.  
  48. })();

QingJ © 2025

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