GameMale
登陆 / 注册 搜索

USERCENTER

SEARCHSITE

搜索

查看: 2733|回复: 59
收起左侧

[实用工具] GM简化1.3

    [复制链接] |关注本帖

GM活动员

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

     楼主| Makima 发表于 2025-8-19 19:29:26 | 显示全部楼层 |阅读模式 <
    增加了对公告的自动关闭
    能不能加入“已读”功能哇

    发现主页和搜索页面和公告还不是一个东西



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

    10.     GM_addStyle(`
    11.         #hd .wp .comiis_nav,
    12.         .md_ctrl,
    13.         p.xg1,
    14.         nav.toc,
    15.         .scbar_hot_td,
    16.         .pls .avatar_p .vm,
    17.         fieldset,
    18.         .hm-t-container,
    19.         .hm-t-main,
    20.         .hm-t-body,
    21.         .dnch_eo_f,
    22.         .sign,
    23.         .signature,
    24.         .bui .m img,
    25.         div[style*="width:90%; margin:0 auto;"],
    26.         li.pm2,
    27.         li.pm2 a.xi2[onclick*="showWindow('sendpm', this.href);"],
    28.         ul[id^="nimba_sidebottom_"],
    29.         div.focus#sitefocus,
    30.         div.focus#focus,
    31.         div.bm.h.cl[onclick*="setcookie('nofocus_forum'"],
    32.         div.bm.h.cl[onclick*="setcookie('nofocus_6'"],
    33.         div#focus_con {
    34.             display: none !important;
    35.             visibility: hidden !important;
    36.             height: 0 !important;
    37.             width: 0 !important;
    38.             margin: 0 !important;
    39.             padding: 0 !important;
    40.             border: 0 !important;
    41.             position: absolute !important;
    42.             clip: rect(0,0,0,0) !important;
    43.         }

    44.         #postlist .plhin {
    45.             background: none !important;
    46.         }

    47.         .pls .avatar img,
    48.         #fastpostform .pls .avatar img,
    49.         .personinformaion .person-imgs img,
    50.         #main .t.t2 table .tr1 table .tac img,
    51.         #um .avt img,
    52.         #tath img,
    53.         .rate table img,
    54.         .rate dd li img,
    55.         .cm .vm img,
    56.         .card_mn .avt img {
    57.             border-radius: 50% !important;
    58.             background-size: cover !important;
    59.             background-position: center !important;
    60.             background-repeat: no-repeat !important;
    61.         }

    62.         .pls .avatar img {
    63.             width: 80px !important;
    64.             height: 80px !important;
    65.             border: none !important;
    66.             padding: 0 !important;
    67.             margin: 0 !important;
    68.         }

    69.         .pls .avatar {
    70.             margin: 10px auto !important;
    71.             width: 80px !important;
    72.             height: 80px !important;
    73.             border-radius: 50% !important;
    74.             border: 2px solid white !important;
    75.             overflow: hidden !important;
    76.             position: relative !important;
    77.         }

    78.         .pls .avatar:before {
    79.             content: "" !important;
    80.             display: block !important;
    81.             padding-top: 100% !important;
    82.         }

    83.         .pls .avatar img {
    84.             position: absolute !important;
    85.             top: 0 !important;
    86.             left: 0 !important;
    87.             right: 0 !important;
    88.             bottom: 0 !important;
    89.         }

    90.         body {
    91.             background: none !important;
    92.         }
    93.     `);

    94.     const blockedUrls = [
    95.         'unwanted-ad.js',
    96.         'banner.jpg',
    97.         'tracking.gif'
    98.     ];

    99.     const handleNode = (node) => {
    100.         if (node.tagName === 'IMG' || node.tagName === 'SCRIPT') {
    101.             blockedUrls.forEach(url => {
    102.                 if (node.src.includes(url)) {
    103.                     if (node.tagName === 'IMG') node.src = '';
    104.                     node.remove();
    105.                 }
    106.             });
    107.         }
    108.         autoCloseAnnouncement(node);
    109.     };

    110.     const autoCloseAnnouncement = (node) => {
    111.         const focusSelectors = [
    112.             'div.focus#sitefocus',
    113.             'div.focus#focus'
    114.         ];

    115.         let focusElement = null;

    116.         focusSelectors.forEach(selector => {
    117.             if (!focusElement && node.querySelector) {
    118.                 focusElement = node.querySelector(selector);
    119.             }
    120.         });

    121.         if (!focusElement && node.nodeType === 1 && node.classList.contains('focus') &&
    122.             (node.id === 'sitefocus' || node.id === 'focus')) {
    123.             focusElement = node;
    124.         }

    125.         if (focusElement) {
    126.             const closeButton = focusElement.querySelector('a[onclick*="setcookie"][onclick*="nofocus"]');
    127.             if (closeButton) {
    128.                 setTimeout(() => {
    129.                     closeButton.click();
    130.                 }, 100);
    131.             } else {
    132.                 focusElement.style.display = 'none';
    133.             }
    134.         }
    135.     };

    136.     const observer = new MutationObserver(mutations => {
    137.         mutations.forEach(mutation => {
    138.             mutation.addedNodes.forEach(node => {
    139.                 if (node.nodeType === 1) handleNode(node);
    140.             });
    141.         });
    142.     });

    143.     observer.observe(document, {
    144.         childList: true,
    145.         subtree: true
    146.     });

    147.     const processExistingContent = () => {
    148.         blockedUrls.forEach(url => {
    149.             document.querySelectorAll(`img[src*="${url}"], script[src*="${url}"]`).forEach(el => el.remove());
    150.         });

    151.         autoCloseAnnouncement(document);
    152.     };

    153.     if (document.readyState === 'loading') {
    154.         document.addEventListener('DOMContentLoaded', processExistingContent);
    155.     } else {
    156.         processExistingContent();
    157.     }
    158. })();
    复制代码

    本帖子中包含更多资源

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

    x

    评分

    参与人数 8金币 +2 血液 +7 追随 +7 堕落 +3 收起 理由
    katn + 1 + 1 美美吸入
    书の妖怪 + 3 谢谢分享
    PURO_ + 1 + 1 + 1 nice
    桀桀桀 + 1 美美吸入
    MuHuang + 3 + 1 + 1 喜翻儿
    f360967847 + 1 喜翻儿
    尘盏供月 + 1 谢谢分享
    Hadley0T + 2 + 1 喜翻儿

    查看全部评分

    回复

    使用道具 举报

    GM活动员

    桂花米糕呆猫灯载情绵鎏彩万幢乘风破浪的武士刀『厢庭望远』巴比伦辞典

      紫-漾 发表于 2025-8-19 19:36:05 | 显示全部楼层 <
      脚本调整后面看着清爽不少,这个公告也是每次登录都要点一次,之前还以为是一次性提醒的
      回复

      使用道具 举报

      Lvl. 10 · I

      GM活动员

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

        凯诺斯 发表于 2025-8-19 19:45:49 | 显示全部楼层 <
        回复

        使用道具 举报

        失去力量的白狼超人醉乡民谣塞巴斯蒂安·斯坦丹妮莉丝·坦格利安希尔瓦娜斯·风行者官复原职虚空之海的鲸

          396149358 发表于 2025-8-19 19:49:19 | 显示全部楼层 <
          回复

          使用道具 举报

          瑞雪兆丰年,生灵万物新野兽之子桂花米糕无尽的怀表命运的轮廓

            尘盏供月 发表于 2025-8-19 19:50:57 | 显示全部楼层 <
            感谢楼主,强迫症每次都要点一下,更加方便在泥潭瑟瑟了。
            追随用完了,明天点,白字为证。
            回复

            使用道具 举报

            桂花米糕达拉然自由吸血魔蝠丛林的鸟飞走了闪耀的魔仙棒蜂蜂小甜心龙腾世纪:审判苏格兰圆脸胖鸡[Pro Max]

              远方传来风笛 发表于 2025-8-19 19:56:12 | 显示全部楼层 <
              回复

              使用道具 举报

              发条八音盒弗雷迪玩偶杰夫‧莫罗萨赫的蛋糕亚索卡洛斯·奥利维拉文森特‧瓦伦丁沃特·沙利文

                枫叶UC 发表于 2025-8-19 19:59:23 | 显示全部楼层 <
                回复

                使用道具 举报

                炽焰咆哮虎桂花米糕弗雷迪玩偶发条八音盒猫咪点唱机

                  Styphon 发表于 2025-8-19 20:05:16 | 显示全部楼层 <
                  回复

                  使用道具 举报

                  20x43 隐形➁抉择20x43 隐形➀You Can Pet Blaidd达拉然SCP-s-1889-第五页Dante

                    crabee 发表于 2025-8-19 20:11:35 | 显示全部楼层 <
                    很实用了,电脑上还好说,平板上这个小公告还是有点不方便的,当然公告已经熟读过了
                    回复

                    使用道具 举报

                    弗雷迪玩偶发条八音盒桂花米糕鎏彩万幢女巫之路虚空之海的鲸【新春限定】果体 隆『召唤好运的角笛』永远的克叔業火死鬥

                      娱乐法师火布偶 发表于 2025-8-19 20:12:47 | 显示全部楼层 <
                      回复

                      使用道具 举报

                      【新手友好】昆進牧羊人GM論壇進階勛章山猫图腾腐化龙幼崽驯化黑龙幼崽念念往日士官盔

                        Lihajte 发表于 2025-8-19 20:16:29 | 显示全部楼层 <
                        回复

                        使用道具 举报

                          万俟 发表于 2025-8-19 20:25:14 | 显示全部楼层 <
                          回复

                          使用道具 举报

                          石肤术炼金之心召唤古代战士黑暗交易雷霆晶球萨赫的蛋糕神秘商店贵宾卡敖蜃星猫咪点唱机

                            Yeries 发表于 2025-8-19 20:31:43 | 显示全部楼层 <
                            回复

                            使用道具 举报

                            布衣+12 传奇的幽灵竹筒冒险用指南针驯化红龙幼崽驯化黑龙幼崽一只小鹿小凤凰

                              Satopika 发表于 2025-8-19 20:37:15 | 显示全部楼层 <
                              还好吧,可能我用的是电脑,本人也没有强迫症,不过有这个脚本看着清爽了不少
                              回复

                              使用道具 举报

                              肉乖乖旧日支配者—克苏鲁業火死鬥魔法不朽·传奇不熄十年一梦炙热的格拉迪欧拉斯卡洛斯·奥利维拉男巫之歌永浴爱河虚空之海的鲸

                                Burry 发表于 2025-8-19 20:39:06 | 显示全部楼层 <
                                回复

                                使用道具 举报

                                森林羊男灯载情绵一只小鹿驯化黑龙幼崽小凤凰嗜血斩首斧命运的轮廓

                                  PKfire 发表于 2025-8-19 20:42:03 | 显示全部楼层 <
                                  对于IP飞来飞去的人来说这小东西简直是究极折磨,所以我要把你简化出去了桀桀桀
                                  回复

                                  使用道具 举报

                                  至死不渝结晶化法杖萨菲罗斯天灾骑士传说中的黑龙不灭狂雷鎏彩万幢瑞雪兆丰年,生灵万物新最终幻想XVI

                                    月读命 发表于 2025-8-19 20:45:54 | 显示全部楼层 <
                                    回复

                                    使用道具 举报

                                    骑兽之子冒险用指南针星芒戒指星光彩虹小粉驼森林鹿珊瑚泡泡鱼夜灯驯化红龙幼崽

                                      lonong 发表于 2025-8-19 20:47:11 | 显示全部楼层 <
                                      回复

                                      使用道具 举报

                                      永远的克叔金钱马车月影狼睡着的小伯苏醒的格罗姆青鸾幸福的小阿尔纯真护剑 · 这把剑守护每个孩子无论他有没有被神选中『厢庭望远』Dante

                                        小晨风 发表于 2025-8-19 20:54:47 | 显示全部楼层 <
                                        回复

                                        使用道具 举报

                                        山猫图腾猎鹰图腾眼镜蛇图腾种植小草夜灯柏树枝

                                          拒绝敷敷99次 发表于 2025-8-19 20:59:32 | 显示全部楼层 <
                                          回复

                                          使用道具 举报

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

                                          本版积分规则

                                          关闭

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

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

                                          GMT+8, 2025-12-6 20:21 , Processed in 0.153719 second(s), 147 queries , Redis On.

                                          Copyright © 2013-2025 GameMale

                                          All Rights Reserved.

                                          快速回复 返回列表