// ==UserScript== // @name Steam Mod Workshop Download Button(Steam创意工坊添加mod下载按钮) // @namespace http://zhangbohun.github.io/ // @version 0.1 // @description Search and download mod via skymods,support does not allow download mods(跳转到skymods网站搜索相应mod下载条目,支持限制外部下载的mod) // @author zhangbohun // @match https://steamcommunity.com/sharedfiles/filedetails/* // @grant none // @run-at document-body // @downloadURL none // ==/UserScript== (function() { 'use strict'; var id = new RegExp("[0-9]{2,15}").exec(document.URL); 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 = 'Download'; button.addEventListener("click",function(){ window.open(baseURL); },false); element.parentNode.appendChild(button); })();