您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Keeps track of your name
当前为
- // ==UserScript==
- // @name Vertix store custom name after refresh vertix.io
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description Keeps track of your name
- // @author Supercap
- // @match http://vertix.io/
- // @grant none
- // ==/UserScript==
- document.getElementById("playerNameInput").onchange = function () {
- setCook("inputName",document.getElementById("playerNameInput").value,100);
- };
- var interval2 = setInterval(function(){
- if(document.getElementById("playerNameInput").value !== "") {
- document.getElementById("playerNameInput").value = getCook("inputName");
- clearInterval(interval2);
- }
- }, 100);
- function setCook(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 getCook(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 "";
- }