GameMale
登陆 / 注册 搜索

USERCENTER

SEARCHSITE

搜索

查看: 333|回复: 22
收起左侧

[实用工具] 【脚本】GM简化(特别版)

[复制链接] |关注本帖

GM活动员

Futūrum(未来)神奇宝贝大师球果体76呆猫炙热的格拉迪欧拉斯永远的克叔亭亭如盖光之少女の魔法书圣甲虫秘典死灵之书

     楼主| Makima 发表于 昨天 22:17 | 显示全部楼层 |阅读模式 <
    应群友的要求,新增了屏蔽:评分,收藏等内容,


    即主楼内容之后就直接二楼
    不想这样也可以用GM简化1.3




    1. // ==UserScript==
    2. // @name              GM简化
    3. // @version           1.4?
    4. // @authoe            MKM
    5. // @match             https://www.gamemale.com/*
    6. // @exclude            https://www.gamemale.com/space*
    7. // @grant             GM_addStyle
    8. // ==/UserScript==
    9. (function() {
    10.     'use strict';

    11.     GM_addStyle(`
    12.         #hd .wp .comiis_nav,
    13.         .md_ctrl,
    14.         p.xg1,
    15.         nav.toc,
    16.         .scbar_hot_td,
    17.         .pls .avatar_p .vm,
    18.         fieldset,
    19.         .hm-t-container,
    20.         .hm-t-main,
    21.         .hm-t-body,
    22.         .dnch_eo_f,
    23.         .sign,
    24.         .signature,
    25.         .bui .m img,
    26.         div[style*="width:90%; margin:0 auto;"],
    27.         li.pm2,
    28.         li.pm2 a.xi2[onclick*="showWindow('sendpm', this.href);"],
    29.         ul[id^="nimba_sidebottom_"],
    30.         div.focus#sitefocus,
    31.         div.focus#focus,
    32.         div.bm.h.cl[onclick*="setcookie('nofocus_forum'"],
    33.         div.bm.h.cl[onclick*="setcookie('nofocus_6'"],
    34.         div#focus_con,
    35.         div.focus#ip_notice,
    36.         div#ip_notice,
    37.         /* 赞助模块 */
    38.         div.bd-dialog,
    39.         div#tr1,
    40.         div.bd-reward-stl,
    41.         button#bdRewardBtn,
    42.         /* 评分模块 */
    43.         h3.psth[class*="xs1"]:has(span.icon_ring),
    44.         dl.rate,
    45.         table.ratl,
    46.         .dxksst_floor,
    47.         div.dxksst_floor_main,
    48.         #dxksst_floor_5767708,
    49.         /* 楼层回复模块 */
    50.         #dxksst_reply_module_5767708,
    51.         #dxksst_floor_smiley_5767708,
    52.         /* 新增:帖子操作按钮行 */
    53.         div#p_btn,
    54.         div.mtw.mbm.hm.cl,
    55.         a#k_favorite,
    56.         a#ak_rate,
    57.         a#k_collect,
    58.         a#recommend_add,
    59.         a#recommend_subtract {
    60.             display: none !important;
    61.             visibility: hidden !important;
    62.             height: 0 !important;
    63.             width: 0 !important;
    64.             margin: 0 !important;
    65.             padding: 0 !important;
    66.             border: 0 !important;
    67.             position: absolute !important;
    68.             clip: rect(0,0,0,0) !important;
    69.         }

    70.         /* 新增:隐藏整个操作按钮容器 */
    71.         tr:has(> td.plc.plm > div#p_btn),
    72.         td.plc.plm:has(> div#p_btn) {
    73.             display: none !important;
    74.         }

    75.         #postlist .plhin {
    76.             background: none !important;
    77.         }

    78.         .pls .avatar img,
    79.         #fastpostform .pls .avatar img,
    80.         .personinformaion .person-imgs img,
    81.         #main .t.t2 table .tr1 table .tac img,
    82.         #um .avt img,
    83.         #tath img,
    84.         .rate table img,
    85.         .rate dd li img,
    86.         .cm .vm img,
    87.         .card_mn .avt img {
    88.             border-radius: 50% !important;
    89.             background-size: cover !important;
    90.             background-position: center !important;
    91.             background-repeat: no-repeat !important;
    92.         }

    93.         .pls .avatar img {
    94.             width: 80px !important;
    95.             height: 80px !important;
    96.             border: none !important;
    97.             padding: 0 !important;
    98.             margin: 0 !important;
    99.         }

    100.         .pls .avatar {
    101.             margin: 10px auto !important;
    102.             width: 80px !important;
    103.             height: 80px !important;
    104.             border-radius: 50% !important;
    105.             border: 2px solid white !important;
    106.             overflow: hidden !important;
    107.             position: relative !important;
    108.         }

    109.         .pls .avatar:before {
    110.             content: "" !important;
    111.             display: block !important;
    112.             padding-top: 100% !important;
    113.         }

    114.         .pls .avatar img {
    115.             position: absolute !important;
    116.             top: 0 !important;
    117.             left: 0 !important;
    118.             right: 0 !important;
    119.             bottom: 0 !important;
    120.         }

    121.         body {
    122.             background: none !important;
    123.         }
    124.     `);

    125.     const blockedUrls = [
    126.         'unwanted-ad.js',
    127.         'banner.jpg',
    128.         'tracking.gif'
    129.     ];

    130.     const handleSecurityNotice = (node) => {
    131.         const securityNotice = node.querySelector ?
    132.             node.querySelector('h2:contains("安全提醒"), *:has(> h2:contains("安全提醒"))') :
    133.             null;

    134.         if (securityNotice && securityNotice.closest) {
    135.             const container = securityNotice.closest('.focus, .plugin, [id*="notice"], [class*="notice"]') || securityNotice.parentElement;

    136.             if (container) {
    137.                 const closeButton = container.querySelector('a[onclick*="setcookie"], a[href*="javascript:;"]');
    138.                 if (closeButton) {
    139.                     closeButton.click();
    140.                 } else {
    141.                     container.style.display = 'none';
    142.                 }

    143.                 try {
    144.                     document.cookie = 'lip=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/';
    145.                 } catch (e) {}
    146.             }
    147.         }
    148.     };

    149.     const handleSponsorModule = (node) => {
    150.         const sponsorSelectors = [
    151.             'div.bd-reward-stl',
    152.             'button#bdRewardBtn',
    153.             'div.bd-dialog',
    154.             'div#tr1'
    155.         ];

    156.         sponsorSelectors.forEach(selector => {
    157.             const elements = node.querySelectorAll ? node.querySelectorAll(selector) : [];
    158.             elements.forEach(el => {
    159.                 el.style.display = 'none';
    160.                 el.style.visibility = 'hidden';
    161.             });
    162.         });

    163.         if (node.id && (node.id === 'bdRewardBtn' || node.id === 'tr1' ||
    164.             node.classList.contains('bd-dialog') || node.classList.contains('bd-reward-stl'))) {
    165.             node.style.display = 'none';
    166.         }
    167.     };

    168.     const handleRatingModule = (node) => {
    169.         const ratingSelectors = [
    170.             'h3.psth:has(span.icon_ring)',
    171.             'dl.rate',
    172.             'table.ratl',
    173.             '.dxksst_floor',
    174.             'div.dxksst_floor_main'
    175.         ];

    176.         ratingSelectors.forEach(selector => {
    177.             const elements = node.querySelectorAll ? node.querySelectorAll(selector) : [];
    178.             elements.forEach(el => {
    179.                 const text = el.textContent || '';
    180.                 if (text.includes('评分') || el.classList.contains('rate') ||
    181.                     el.classList.contains('dxksst_floor')) {
    182.                     el.style.display = 'none';
    183.                 }
    184.             });
    185.         });

    186.         const ratingText = node.textContent || '';
    187.         if ((node.nodeName === 'H3' && ratingText.includes('评分')) ||
    188.             node.classList.contains('rate') ||
    189.             node.classList.contains('ratl') ||
    190.             node.classList.contains('dxksst_floor')) {
    191.             node.style.display = 'none';
    192.         }
    193.     };

    194.     const handlePostButtons = (node) => {
    195.         const postButtonSelectors = [
    196.             'div#p_btn',
    197.             'div.mtw.mbm.hm.cl',
    198.             'a#k_favorite',
    199.             'a#ak_rate',
    200.             'a#k_collect',
    201.             'a#recommend_add',
    202.             'a#recommend_subtract'
    203.         ];

    204.         postButtonSelectors.forEach(selector => {
    205.             const elements = node.querySelectorAll ? node.querySelectorAll(selector) : [];
    206.             elements.forEach(el => {
    207.                 el.style.display = 'none';
    208.                 el.style.visibility = 'hidden';
    209.             });
    210.         });

    211.         if (node.id === 'p_btn' ||
    212.             (node.classList &&
    213.              (node.classList.contains('mtw') &&
    214.               node.classList.contains('mbm') &&
    215.               node.classList.contains('hm') &&
    216.               node.classList.contains('cl'))) ||
    217.             ['k_favorite', 'ak_rate', 'k_collect', 'recommend_add', 'recommend_subtract'].includes(node.id)) {
    218.             node.style.display = 'none';
    219.         }

    220.         const text = node.textContent || '';
    221.         if (text.includes('收藏') || text.includes('评分') ||
    222.             text.includes('淘帖') || text.includes('顶') || text.includes('踩')) {
    223.             node.style.display = 'none';
    224.         }
    225.     };

    226.     const handleNode = (node) => {
    227.         if (node.tagName === 'IMG' || node.tagName === 'SCRIPT') {
    228.             blockedUrls.forEach(url => {
    229.                 if (node.src.includes(url)) {
    230.                     if (node.tagName === 'IMG') node.src = '';
    231.                     node.remove();
    232.                 }
    233.             });
    234.         }
    235.         autoCloseAnnouncement(node);
    236.         handleSecurityNotice(node);
    237.         handleSponsorModule(node);
    238.         handleRatingModule(node);
    239.         handlePostButtons(node);
    240.     };

    241.     const autoCloseAnnouncement = (node) => {
    242.         const focusSelectors = [
    243.             'div.focus#sitefocus',
    244.             'div.focus#focus'
    245.         ];

    246.         let focusElement = null;

    247.         focusSelectors.forEach(selector => {
    248.             if (!focusElement && node.querySelector) {
    249.                 focusElement = node.querySelector(selector);
    250.             }
    251.         });

    252.         if (!focusElement && node.nodeType === 1 && node.classList.contains('focus') &&
    253.             (node.id === 'sitefocus' || node.id === 'focus')) {
    254.             focusElement = node;
    255.         }

    256.         if (focusElement) {
    257.             const closeButton = focusElement.querySelector('a[onclick*="setcookie"][onclick*="nofocus"]');
    258.             if (closeButton) {
    259.                 setTimeout(() => {
    260.                     closeButton.click();
    261.                 }, 100);
    262.             } else {
    263.                 focusElement.style.display = 'none';
    264.             }
    265.         }
    266.     };

    267.     const observer = new MutationObserver(mutations => {
    268.         mutations.forEach(mutation => {
    269.             mutation.addedNodes.forEach(node => {
    270.                 if (node.nodeType === 1) handleNode(node);
    271.             });
    272.         });
    273.     });

    274.     observer.observe(document, {
    275.         childList: true,
    276.         subtree: true
    277.     });

    278.     const processExistingContent = () => {
    279.         blockedUrls.forEach(url => {
    280.             document.querySelectorAll(`img[src*="${url}"], script[src*="${url}"]`).forEach(el => el.remove());
    281.         });

    282.         autoCloseAnnouncement(document);
    283.         handleSecurityNotice(document);
    284.         handleSponsorModule(document);
    285.         handleRatingModule(document);
    286.         handlePostButtons(document);

    287.         document.querySelectorAll('.bd-dialog, #tr1, .bd-reward-stl, #bdRewardBtn, dl.rate, table.ratl, .dxksst_floor, #p_btn, .mtw.mbm.hm.cl, #k_favorite, #ak_rate, #k_collect, #recommend_add, #recommend_subtract').forEach(el => {
    288.             el.style.display = 'none';
    289.         });

    290.         document.querySelectorAll('a').forEach(el => {
    291.             const text = el.textContent || '';
    292.             if (text.includes('收藏') || text.includes('评分') ||
    293.                 text.includes('淘帖') || text.includes('顶') || text.includes('踩')) {
    294.                 el.style.display = 'none';
    295.             }
    296.         });
    297.     };

    298.     if (document.readyState === 'loading') {
    299.         document.addEventListener('DOMContentLoaded', processExistingContent);
    300.     } else {
    301.         processExistingContent();
    302.     }

    303.     setInterval(() => {
    304.         handleSecurityNotice(document);
    305.         handleSponsorModule(document);
    306.         handleRatingModule(document);
    307.         handlePostButtons(document);
    308.     }, 2000);
    309. })();
    复制代码


    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x

    评分

    参与人数 2血液 +4 追随 +2 堕落 +1 收起 理由
    Hadley0T + 3 + 1 非常好
    cinder + 1 + 1 + 1

    查看全部评分

    回复

    使用道具 举报

    Lvl. 0

    『炫目的铁塔』救命饮料适当显灵鎏彩万幢

      fhlzw 发表于 昨天 22:25 | 显示全部楼层 <
      回复

      使用道具 举报

      史莱哲林没有梦想的咸鱼救命饮料召唤古代战士『天圆地方』Amicus收到情书灵光补脑剂诺克提斯·路西斯·伽拉姆業火死鬥

        赴约波波 发表于 昨天 22:35 | 显示全部楼层 <
        回复

        使用道具 举报

        近地夜航雷文克劳没有梦想的咸鱼『天圆地方』Amicus光明奇幻木偶遭遇死神敖蜃星

          Rolf_0 发表于 昨天 22:39 | 显示全部楼层 <
          回复

          使用道具 举报

          帅气的本・比格Amicus肉乖乖光明奇幻木偶『天圆地方』弗雷迪玩偶遗留之人的城堡猫咪点唱机吃饱金币的Doge永远的克叔

            zibatco2 发表于 昨天 22:54 | 显示全部楼层 <
            连这个都可以屏蔽也是相当厉害的插件惹 虽然个人觉得应该是用不上~还是感谢楼主分享啦
            回复

            使用道具 举报

            卡斯迪奥我的路从时间蜿蜒而出男巫之歌女巫之路『伊黎丝的赞美词』『星河碎片』『流星赶月:宙刃』『林中过夜』『厢庭望远』幸运女神的微笑

              Hadley0T 发表于 昨天 22:55 | 显示全部楼层 <
              本帖最后由 Hadley0T 于 2026-1-28 22:57 编辑

              是的,一切都是我做的,因为有时候看贴不用那么多有的没的
              回复

              使用道具 举报

              诺克提斯·路西斯·伽拉姆亚当‧简森詹米·多南双贤辉石头罩艾尔登法环骑士先生迪恩‧温彻斯特

                Se7en 发表于 昨天 22:56 | 显示全部楼层 <
                回复

                使用道具 举报

                冒险用指南针『随时随地开启!』破损的旧书『随时随地开启!』雪王的心脏人鱼之泪苏格兰圆脸胖鸡[Pro Max]丛林的鸟飞走了不曾寄出的信件幽灵竹筒

                  凯诺斯 发表于 昨天 22:58 | 显示全部楼层 <
                  回复

                  使用道具 举报

                  飞天小糖果光明奇幻木偶Amicus人到中年裸体克里斯【圣诞限定】心心念念小雪人隐秘的讯息黑曜石赤螯蝎虚空之海的鲸网中的皮卡丘

                    cinder 发表于 昨天 23:06 | 显示全部楼层 <
                    回复

                    使用道具 举报

                    光明奇幻木偶『天圆地方』Amicus鎏彩万幢女巫之路虚空之海的鲸永远的克叔業火死鬥实现梦想官复原职

                      娱乐法师火布偶 发表于 昨天 23:07 | 显示全部楼层 <
                      回复

                      使用道具 举报

                      【新手友好】昆進『正在入住GM村』石肤术捡到了肥皂炼金之心格林星变骚喷雾收到情书

                        1458209048 发表于 昨天 23:16 | 显示全部楼层 <
                        回复

                        使用道具 举报

                          lqiang1990 发表于 昨天 23:22 | 显示全部楼层 <
                          回复

                          使用道具 举报

                          寻觅箭术卷轴GM論壇榮譽勛章桑克瑞德·沃特斯格拉迪欧拉斯库伦 (审判)威尔卡斯迈克尔迈尔斯

                            7k7k 发表于 昨天 23:23 | 显示全部楼层 <
                            回复

                            使用道具 举报

                            黄金树的恩惠炽天使之拥元灵化法杖遗留之人的城堡

                              reober3 发表于 昨天 23:23 | 显示全部楼层 <
                              回复

                              使用道具 举报

                              【夏日限定】夏日的泰凯斯裸体克里斯男用贞操带不曾寄出的信件破损的旧书雪王的心脏幽灵竹筒冒险用指南针GM論壇榮譽勛章龙腾世纪:审判

                                crino66666 发表于 昨天 23:31 | 显示全部楼层 <
                                回复

                                使用道具 举报

                                捡到了肥皂千杯不醉收到情书变骚喷雾最终幻想XIV晓月终焉神奇四叶草先祖之魂苏格兰圆脸胖鸡[Pro Max]安德森‧戴维斯

                                  被宽恕的色欲 发表于 昨天 23:37 | 显示全部楼层 <
                                  确实简约了很多啊,虽然站街站久了用这个能屏蔽一些,但已经习惯了呢,不过还是谢谢楼主的插件了
                                  回复

                                  使用道具 举报

                                  Amicus『厢庭望远』『狄文卡德的残羽』检定场命运的轮廓荧光水母河豚寿司无限魔典皮卡丘达拉然

                                    zhuovboyan 发表于 昨天 23:48 | 显示全部楼层 <
                                    回复

                                    使用道具 举报

                                    肉乖乖旧日支配者—克苏鲁業火死鬥魔法不朽·传奇不熄十年一梦帅气的本・比格炙热的格拉迪欧拉斯炽焰咆哮虎永浴爱河男巫之歌

                                      Burry 发表于 昨天 23:48 | 显示全部楼层 <
                                      回复

                                      使用道具 举报

                                      时间变异管理局双重身份邦尼尼霹天雳地人鱼之泪帅气的本・比格弗雷迪玩偶妙手空空

                                        盘上雷 发表于 昨天 23:50 | 显示全部楼层 <
                                        极简版论坛看上去很清爽呢,满足部分人的特殊需求了,三百多行代码看着就是大工程
                                        回复

                                        使用道具 举报

                                        鎏彩万幢传奇都市:天际线2刀锋女王 - 归宿丹妮莉丝·坦格利安官复原职实现梦想丹雀衔五穗,人间始丰登Zootopia最终幻想XVI

                                          娱乐伙伴琴键猴 发表于 2 小时前 | 显示全部楼层 <
                                          回复

                                          使用道具 举报

                                          您需要登录后才可以回帖 登录 | 立即注册

                                          本版积分规则

                                          关闭

                                          站长公告上一条 /1 下一条

                                          文字版|手机版|小黑屋|GameMale

                                          GMT+8, 2026-1-29 03:28 , Processed in 0.146157 second(s), 146 queries , Redis On.

                                          Copyright © 2013-2026 GameMale

                                          All Rights Reserved.

                                          快速回复 返回列表