Greasy Fork

Greasy Fork is available in English.

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

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

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         NGA优化摸鱼体验-调整浏览宽度
// @version      0.3.2
// @author       xiaoyaoyuxin
// @description  自定义NGA列表宽度和贴内宽度
// @license      MIT
// @match        *://bbs.nga.cn/*
// @match        *://ngabbs.com/*
// @match        *://nga.178.com/*
// @match        *://g.nga.cn/*
// @grant        unsafeWindow
// @run-at       document-start
// @inject-into  content
// @namespace https://github.com/xiaoyaoyuxin
// ==/UserScript==

(function (registerPlugin) {
    'use strict';
    registerPlugin({
        name: 'widthAuto',  // 插件唯一KEY
        title: 'NGA调整宽度',  // 插件名称
        desc: '自定义列表宽度和贴内宽度',  // 插件说明
        settings: [{
            key: 'listWidth',
            title: '自定义宽度',
            default: 1200
        } ],
        initFunc: function () {
            let customWidth = this.pluginSettings['listWidth'];
            //页面
            mc.style.width = customWidth + "px";
            mc.style.marginLeft = "auto";
            mc.style.marginRight = "auto";
            /*
            //帖子列表
            let threadList = document.getElementById("topicrows");
            if (threadList) {
                threadList.style.width = customWidth + "px";
                threadList.style.marginLeft = "auto";
                threadList.style.marginRight = "auto";
            }

            //帖子详情
            let threadDetail = document.getElementById("m_posts");
            if (threadDetail) {
                threadDetail.style.width = customWidth + "px";
                threadDetail.style.marginLeft = "auto";
                threadDetail.style.marginRight = "auto";
            }

            //页码按钮
            let threadBtntop = document.getElementById("m_pbtntop");
            if (threadBtntop) {
                threadBtntop.style.width = customWidth + "px";
                threadBtntop.style.marginLeft = "auto";
                threadBtntop.style.marginRight = "auto";
            }
            let threadBtnbtm = document.getElementById("m_pbtnbtm");
            if (threadBtnbtm) {
                threadBtnbtm.style.width = customWidth + "px";
                threadBtnbtm.style.marginLeft = "auto";
                threadBtnbtm.style.marginRight = "auto";
            }
            */
        }
    })

})(function(plugin) {
    plugin.meta = GM_info.script
    unsafeWindow.ngaScriptPlugins = unsafeWindow.ngaScriptPlugins || []
    unsafeWindow.ngaScriptPlugins.push(plugin)
});