您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Auto-fill the trade form from URL parameters
当前为
// ==UserScript== // @name Trade Offer URL Helper // @namespace http://knightsradiant.pw/ // @version 0.3 // @description Auto-fill the trade form from URL parameters // @require https://code.jquery.com/jquery-3.4.1.min.js // @author Talus // @match https://politicsandwar.com/nation/trade/create/* // @grant none // ==/UserScript== (function() { var $ = window.jQuery; $.urlParam = function(name){ var results = new RegExp('[\?&]' + name + '=([^&#]*)', 'i').exec(window.location.href); if (results) { return results[1] || 0; } } $('#amount').val($.urlParam('amount')); $('#priceper').val($.urlParam('ppu')); if ($.urlParam('action')) { var action = $.urlParam('action').toLowerCase(); switch (action) { case 'buy': $('*[data-target="#buyConfirmation"]').css('border-radius', '6px') $('*[data-target="#sellConfirmation"]').hide() break; case 'sell': $('*[data-target="#sellConfirmation"]').css('border-radius', '6px') $('*[data-target="#buyConfirmation"]').hide() break; } } })();