赛博朋克2077vv1.32026年10月12日 更新

CP2077 Nexus Mods 页面清理

用于在 Cyberpunk 2077 的 Nexus Mods 页面上切换隐藏特定内容;若想要永久解决方案,请参考正文中的论坛链接。需要 Tampermonkey。

此脚本用于在 Nexus Mods 页面上切换隐藏特定内容。若要永久解决方案,请查看以下讨论:

安装

需要安装 Tampermonkey 才能使用。将以下脚本添加到 Tampermonkey:

// ==UserScript==
// @name         Sanitize
// @namespace    http://tampermonkey.net/
// @version      1.3
// @description  try to take over the world!
// @author       You (are breathtaking!)
// @match        https://www.nexusmods.com/cyberpunk2077
// @match        https://www.nexusmods.com/cyberpunk2077/mods/*
// @match        https://www.nexusmods.com/cyberpunk2077/trending/
// @match        https://www.nexusmods.com/cyberpunk2077/mods/categories/
// @match        https://www.nexusmods.com/cyberpunk2077?tab=*
// @grant        none
// @run-at       document-end
// @require      https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js
// ==/UserScript==

this.$ = this.jQuery = window.jQuery.noConflict(true);

(function() {
 var m = window.jQuery("#mod-list");
 var g = window.jQuery("#game-mods");
    if (m.length > 0 || g.length > 0)
    {
        console.log("we r here");
        window.jQuery(document).ajaxStop(function () {
            console.log("ajaxStop complete");
            updateHTML();
        });
        window.jQuery(document).ajaxComplete(function (e, request, settings) {
            console.log("ajaxComplete start to remove clutter", settings);
            updateHTML();
        })
     if(g.length > 0)
     {
        console.log('g'+g.length);
        var origOpen = XMLHttpRequest.prototype.open;
        XMLHttpRequest.prototype.open = function() {
            console.log('request started!');
            this.addEventListener('load', function() {
                console.log('sanitize!');
                updateHTML();
            });
            origOpen.apply(this, arguments);
        };
     }
    if (document.URL.endsWith("cyberpunk2077") ||
        document.URL.endsWith("cyberpunk2077/mods/") ||
        document.URL.endsWith("mods/trending/") ||
        document.URL.includes("mods/categories/")
       )
        {
        if(!document.URL.endsWith("/mods/categories"))
        {
            updateHTML();
        }
        }
function updateHTML()
{
    $('li').each(function(){
        if($(this).text().toLowerCase().includes("reshade") ||
           $(this).text().toLowerCase().includes("shader") ||
           $(this).text().toLowerCase().includes("savegame") ||
           $(this).text().toLowerCase().includes("save game") ||
           $(this).text().toLowerCase().includes("savegames") ||
           $(this).text().toLowerCase().includes("save games") ||
           $(this).text().toLowerCase().includes("preset") ||
           $(this).text().toLowerCase().includes("presets") ||
           $(this).text().toLowerCase().includes("savefile") ||
           $(this).text().toLowerCase().includes("savefiles") ||
           $(this).text().toLowerCase().includes("save file") ||
           $(this).text().toLowerCase().includes("saved file") ||
           $(this).text().toLowerCase().includes("save files") ||
           $(this).text().toLowerCase().includes("starting save") ||
           $(this).text().toLowerCase().includes("starting saves") ||
           $(this).text().toLowerCase().includes("starter save") ||
           $(this).text().toLowerCase().includes("starter saves") ||
           $(this).text().toLowerCase().includes("fresh start") ||
           $(this).text().toLowerCase().includes("mode plus") ||
           $(this).text().toLowerCase().includes("save location") ||
           $(this).text().includes("Characters"))
            {
                if(!$(this).text().includes("CP2077 Nexus Mods Declutter"))
                {
                    $(this).remove();
                }
            }
    });
}
    }
})();

来源与文件

文件说明

You need Tampermonkey for this to work

来源列出的依赖与关系

前往 N 网打开所选文件。安装与下载要求以原作者及平台说明为准。

<!-- aoe-mods-source:nexusmods:cyberpunk2077:465 -->

下载模块

共 1 个来源
立即下载推荐来源
前往下载