Greasy Fork

Nexusmods skyrim&fallout japan database

Nexusmodsのスカイリム、フォールアウト4ページに、日本MODデータベースへのリンクを追加します

当前为 2017-09-16 提交的版本,查看 最新版本

// ==UserScript==
// @name        Nexusmods skyrim&fallout japan database
// @namespace   mikanNsjd
// @version     3.0
// @description Nexusmodsのスカイリム、フォールアウト4ページに、日本MODデータベースへのリンクを追加します
// @author      mikan-megane
// @grant       none
// @include     https://www.nexusmods.com/skyrim/mods/*
// @include     https://www.nexusmods.com/skyrimspecialedition/mods/*
// @include     https://www.nexusmods.com/fallout4/mods/*
// ==/UserScript==

var skyrim = document.URL.match(/https?:\/\/(?:www\.)?nexusmods\.com\/skyrim\/mods\/(\d+)(?:$|\/.+)/);
var skyrimsp = document.URL.match(/https?:\/\/(?:www\.)?nexusmods\.com\/skyrimspecialedition\/mods\/(\d+)(?:$|\/.+)/);
var fallout4 = document.URL.match(/https?:\/\/(?:www\.)?nexusmods\.com\/fallout4\/mods\/(\d+)(?:$|\/.+)/);

var el = document.querySelector(".tabbed-buttons div:first-child");

if (skyrim) {
	el.insertAdjacentHTML('beforebegin', '<div class="action-button green"><a href="http://skyrim.2game.info/detail.php?id='+skyrim[1]+'">日本MODデータベースへ</a></div> ');
} else if (skyrimsp) {
	el.insertAdjacentHTML('beforebegin', '<div class="action-button green"><a href="http://skyrimspecialedition.2game.info/detail.php?id='+skyrimsp[1]+'">日本MODデータベースへ</a></div> ');
} else if (fallout4) {
	el.insertAdjacentHTML('beforebegin', '<div class="action-button green"><a href="http://fallout4.2game.info/detail.php?id='+fallout4[1]+'">日本MODデータベースへ</a></div> ');
}