To Japanese Mods Database

SteamのRimWorldワークショップ、NexusmodsのSkyrim、Fallout、MB2 Bannerlord、Cyberpunk2077、Starfield、Oblivion Remasteredのページに、日本語MODデータベースへのリンクを追加します

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        To Japanese Mods Database
// @namespace   mikanNsjd
// @version     7.0
// @description SteamのRimWorldワークショップ、NexusmodsのSkyrim、Fallout、MB2 Bannerlord、Cyberpunk2077、Starfield、Oblivion Remasteredのページに、日本語MODデータベースへのリンクを追加します
// @author      mikan-megane
// @grant       none
// @match       https://*.nexusmods.com/skyrim/mods/*
// @match       https://*.nexusmods.com/skyrimspecialedition/mods/*
// @match       https://*.nexusmods.com/fallout4/mods/*
// @match       https://*.nexusmods.com/fallout76/mods/*
// @match       https://*.nexusmods.com/mountandblade2bannerlord/mods/*
// @match       https://*.nexusmods.com/cyberpunk2077/mods/*
// @match       https://*.nexusmods.com/starfield/mods/*
// @match       https://*.nexusmods.com/oblivionremastered/mods/*
// @match       https://steamcommunity.com/sharedfiles/filedetails/*
// @match       https://steamcommunity.com/workshop/filedetails/*
// ==/UserScript==
(function () {
    let url;
    if (location.hostname === 'steamcommunity.com') {
        if (document.querySelector('.apphub_AppName').textContent === 'RimWorld') {
            url = location.search.match(/id=(\d+)/);
            if (url !== null) {
                if (document.querySelector('#rightContents .sidebar') !== null) {
                    document.querySelector('#rightContents .sidebar').insertAdjacentHTML('beforebegin', '<div class="panel"><a class="btnv6_blue_hoverfade btn_medium" target="_blank" href="https://rimworld.2game.info/detail.php?id=' + url[1] + '"><span>RimWorld Mod データベース</span></a></div>');
                }
            }
        }
    } else {
        url = location.pathname.match(/(.*)\/mods\/(\d+)/);
        if (url !== null) {
            let selector = document.querySelector(".modactions > li:first-child");
            if (document.querySelector(".modactions > .dllabel") !== null) {
                selector = document.querySelector(".modactions > .dllabel");
            }
            selector.insertAdjacentHTML('beforebegin', '<li id="action-jp"><a class="btn inline-flex" href="https://' + url[1] + '.2game.info/detail.php?id=' + url[2] + '"><span class="flag flag-Japanese" style="padding: 0.5em;padding-right: 15px;"></span> <span class="flex-label">日本語</span></a></li>');
        }
    }
}());