Steam Mod Workshop Download Button(Steam创意工坊添加mod下载按钮)

Search and download mod via steamworkshop.download,support does not allow download mods(跳转到steamworkshop.download网站搜索相应mod下载条目,支持限制外部下载的mod)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Steam Mod Workshop Download Button(Steam创意工坊添加mod下载按钮)
// @namespace    http://zhangbohun.github.io/
// @version      0.2
// @description  Search and download mod via steamworkshop.download,support does not allow download mods(跳转到steamworkshop.download网站搜索相应mod下载条目,支持限制外部下载的mod)
// @author       zhangbohun
// @match        https://steamcommunity.com/sharedfiles/filedetails/*
// @grant        none
// @run-at       document-idle
// ==/UserScript==

(function() {
    'use strict';
	var id = new RegExp("[0-9]{2,15}").exec(document.URL);
	var baseURL='http://steamworkshop.download/download/view/'+id;
	//var baseURL='http://catalogue.smods.ru/?s='+id;

    var element = document.getElementById("AddToCollectionBtn");
    var button = document.createElement('span');
    button.setAttribute('class', 'general_btn share tooltip');
	button.setAttribute('data-tooltip-text', 'search mod via skymods');
    button.innerHTML = '<span>Download</span>';
    button.addEventListener("click",function(){
		window.open(baseURL);
	},false);
    element.parentNode.appendChild(button);
})();