您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Bored from codeforces changing your language? Use this
// ==UserScript== // @name Preferred language setter // @namespace http://tampermonkey.net/ // @version 1.0 // @description Bored from codeforces changing your language? Use this // @author SuperJava // @match http://codeforces.com/*/submit // @match http://codeforces.com/*/submit?* // @match http://codeforces.com/*/*/*/* // @grant none // ==/UserScript== var z = document.getElementsByName('programTypeId')[0]; if(checkCookie('preflang')){ z.value = getCookie('preflang'); } $('<button type="button" id="SuperJava" style="margin-left:10px;">Save Option</button><span id="norsq" style="margin-left:10px;"> </span>').insertAfter(z); $('#SuperJava').click(function(){ setCookie('preflang',z.value,30); $('#norsq').text('Updated!'); setTimeout(function(){$('#norsq').text('');},2000); }); function setCookie(cname, cvalue, exdays) { var d = new Date(); d.setTime(d.getTime() + (exdays*24*60*60*1000)); var expires = "expires="+ d.toUTCString(); document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; } function getCookie(cname) { var name = cname + "="; var decodedCookie = decodeURIComponent(document.cookie); var ca = decodedCookie.split(';'); for(var i = 0; i <ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; } function checkCookie(cname) { var username = getCookie(cname); if (username != "") { return true; } else { return false; } }