NGA优化摸鱼体验-调整浏览宽度

自定义NGA列表宽度和贴内宽度

  1. // ==UserScript==
  2. // @name NGA优化摸鱼体验-调整浏览宽度
  3. // @version 0.3.2
  4. // @author xiaoyaoyuxin
  5. // @description 自定义NGA列表宽度和贴内宽度
  6. // @license MIT
  7. // @match *://bbs.nga.cn/*
  8. // @match *://ngabbs.com/*
  9. // @match *://nga.178.com/*
  10. // @match *://g.nga.cn/*
  11. // @grant unsafeWindow
  12. // @run-at document-start
  13. // @inject-into content
  14. // @namespace https://github.com/xiaoyaoyuxin
  15. // ==/UserScript==
  16.  
  17. (function (registerPlugin) {
  18. 'use strict';
  19. registerPlugin({
  20. name: 'widthAuto', // 插件唯一KEY
  21. title: 'NGA调整宽度', // 插件名称
  22. desc: '自定义列表宽度和贴内宽度', // 插件说明
  23. settings: [{
  24. key: 'listWidth',
  25. title: '自定义宽度',
  26. default: 1200
  27. } ],
  28. initFunc: function () {
  29. let customWidth = this.pluginSettings['listWidth'];
  30. //页面
  31. mc.style.width = customWidth + "px";
  32. mc.style.marginLeft = "auto";
  33. mc.style.marginRight = "auto";
  34. /*
  35. //帖子列表
  36. let threadList = document.getElementById("topicrows");
  37. if (threadList) {
  38. threadList.style.width = customWidth + "px";
  39. threadList.style.marginLeft = "auto";
  40. threadList.style.marginRight = "auto";
  41. }
  42.  
  43. //帖子详情
  44. let threadDetail = document.getElementById("m_posts");
  45. if (threadDetail) {
  46. threadDetail.style.width = customWidth + "px";
  47. threadDetail.style.marginLeft = "auto";
  48. threadDetail.style.marginRight = "auto";
  49. }
  50.  
  51. //页码按钮
  52. let threadBtntop = document.getElementById("m_pbtntop");
  53. if (threadBtntop) {
  54. threadBtntop.style.width = customWidth + "px";
  55. threadBtntop.style.marginLeft = "auto";
  56. threadBtntop.style.marginRight = "auto";
  57. }
  58. let threadBtnbtm = document.getElementById("m_pbtnbtm");
  59. if (threadBtnbtm) {
  60. threadBtnbtm.style.width = customWidth + "px";
  61. threadBtnbtm.style.marginLeft = "auto";
  62. threadBtnbtm.style.marginRight = "auto";
  63. }
  64. */
  65. }
  66. })
  67.  
  68. })(function(plugin) {
  69. plugin.meta = GM_info.script
  70. unsafeWindow.ngaScriptPlugins = unsafeWindow.ngaScriptPlugins || []
  71. unsafeWindow.ngaScriptPlugins.push(plugin)
  72. });

QingJ © 2025

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