GameMale
登陆 / 注册 搜索

USERCENTER

SEARCHSITE

搜索

查看: 3176|回复: 58
收起左侧

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

  [复制链接] |关注本帖

GM活动员

背带鸭Futūrum(未来)果体76裸体克里斯炙热的格拉迪欧拉斯众志成城光之少女の魔法书♬狂舞终乐章♬亭亭如盖

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


    即主楼内容之后就直接二楼
    不想这样也可以用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

    评分

    参与人数 4血液 +12 追随 +4 堕落 +1 收起 理由
    是阿行嘞 + 1 感谢分享
    亚洛斯 + 8 + 1 喜翻儿厚
    Hadley0T + 3 + 1 非常好
    cinder + 1 + 1 + 1

    查看全部评分

    回复

    使用道具 举报

    Lvl. 0

    鎏彩万幢

      fhlzw 发表于 2026-1-28 22:25:23 | 显示全部楼层 <
      回复

      使用道具 举报

      萨赫的蛋糕『莲花宝灯』火玛瑙『住在GM村』救命饮料杰森‧斯坦森刺杀者匕首猩红魔鹫位面引航器史莱姆牧场

        赴约波波 发表于 2026-1-28 22:35:58 | 显示全部楼层 <
        回复

        使用道具 举报

        男巫之歌巨力橡果裸体克里斯Forever Titanic雪域的站台索林·临终一役【新春限定】果体 隆岛田半藏繁衍之歌

          Rolf_0 发表于 2026-1-28 22:39:12 | 显示全部楼层 <
          回复

          使用道具 举报

          猫咪点唱机裸体克里斯帅气的本・比格Amicus肉乖乖羽环鳐可鲁贝洛斯【新春限定】果体 隆火玛瑙永远的克叔

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

            使用道具 举报

            迪恩‧温彻斯特卡斯迪奥

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

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

              使用道具 举报

              裸体克里斯『落樱缤纷』【新春限定】果体 隆火玛瑙隐秘的讯息『宝莲灯』索尔·奥丁森位面引航器塞拉斯月影狼

                Se7en 发表于 2026-1-28 22:56:05 | 显示全部楼层 <
                回复

                使用道具 举报

                炼金之心『随时随地开启!』破损的旧书『随时随地开启!』雪王的心脏人鱼之泪苏格兰圆脸胖鸡[Pro Max]位面引航器不曾寄出的信件幽灵竹筒

                  凯诺斯 发表于 2026-1-28 22:58:46 | 显示全部楼层 <
                  回复

                  使用道具 举报

                  『莲花宝灯』火玛瑙史莱姆牧场男巫之歌【新春限定】果体 隆成为蝙蝠侠小镇的站台永远的克叔裸体克里斯【圣诞限定】心心念念小雪人

                    cinder 发表于 2026-1-28 23:06:27 | 显示全部楼层 <
                    回复

                    使用道具 举报

                    鎏彩万幢男巫之歌女巫之路虚空之海的鲸業火死鬥实现梦想官复原职缘起星空Zootopia丹雀衔五穗,人间始丰登

                      娱乐法师火布偶 发表于 2026-1-28 23:07:13 | 显示全部楼层 <
                      回复

                      使用道具 举报

                      最终幻想XVI荒野大镖客:救赎 II最终幻想XIV驯化黑龙幼崽香喷喷的烤鸡红龙幼崽

                        1458209048 发表于 2026-1-28 23:16:12 | 显示全部楼层 <
                        回复

                        使用道具 举报

                        火玛瑙裸体克里斯

                          lqiang1990 发表于 2026-1-28 23:22:54 | 显示全部楼层 <
                          回复

                          使用道具 举报

                          诺克提斯·路西斯·伽拉姆桑克瑞德·沃特斯格拉迪欧拉斯史蒂文·格兰特康纳‧沃什接近阴谋堕落之舞塞拉斯

                            7k7k 发表于 2026-1-28 23:23:13 | 显示全部楼层 <
                            回复

                            使用道具 举报

                            『大元素使』十字叶章炽天使之拥被释放的灵魂男巫之歌

                              reober3 发表于 2026-1-28 23:23:37 | 显示全部楼层 <
                              回复

                              使用道具 举报

                              男巫之歌【夏日限定】夏日的泰凯斯裸体克里斯男用贞操带不曾寄出的信件破损的旧书雪王的心脏幽灵竹筒龙腾世纪:审判丛林的鸟飞走了

                                crino66666 发表于 2026-1-28 23:31:32 | 显示全部楼层 <
                                回复

                                使用道具 举报

                                最终幻想XIV晓月终焉神奇四叶草幽灵竹筒我已倾听,我已感受,我已思考隐秘的讯息位面引航器巴哈姆特卡洛斯·奥利维拉丹雀衔五穗,人间始丰登

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

                                  使用道具 举报

                                  河豚寿司荧光水母命运的轮廓检定场『狄文卡德的残羽』『厢庭望远』万众瞩目神奇宝贝大师球神奇宝贝图鉴无限魔典

                                    zhuovboyan 发表于 2026-1-28 23:48:42 | 显示全部楼层 <
                                    回复

                                    使用道具 举报

                                    黑暗交易業火死鬥魔法不朽·传奇不熄不舍的挽留帅气的本・比格十年一梦炽焰咆哮虎炙热的格拉迪欧拉斯永浴爱河男巫之歌

                                      Burry 发表于 2026-1-28 23:48:56 | 显示全部楼层 <
                                      回复

                                      使用道具 举报

                                      被踩烂的小草

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

                                        使用道具 举报

                                        裸体克里斯火玛瑙鎏彩万幢传奇都市:天际线2刀锋女王 - 归宿丹妮莉丝·坦格利安官复原职实现梦想丹雀衔五穗,人间始丰登

                                          娱乐伙伴琴键猴 发表于 2026-1-29 00:31:57 | 显示全部楼层 <
                                          回复

                                          使用道具 举报

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

                                          本版积分规则

                                          关闭

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

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

                                          GMT+8, 2026-4-1 14:27 , Processed in 0.176519 second(s), 149 queries , Redis On.

                                          Copyright © 2013-2026 GameMale

                                          All Rights Reserved.

                                          快速回复 返回列表