GreaseMonkey_SuperValues-minified

Extends the GM_setValue and GM_getValue functions for any javascript variable type.

Mint 2016.04.28.. Lásd a legutóbbi verzió

Ezt a szkriptet nem ajánlott közvetlenül telepíteni. Ez egy könyvtár más szkriptek számára, amik tartalmazzák a // @require https://update.greatest.deepsurf.us/scripts/19190/122464/GreaseMonkey_SuperValues-minified.js hivatkozást.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

var GM_SuperValue=new function(){function ReportError(e){if(!console||!console.error)throw new Error(e);console.error(e)}var JSON_MarkerStr="json_val: ",FunctionMarker="function_code: ";"function"!=typeof GM_setValue&&ReportError("This library requires Greasemonkey! GM_setValue is missing."),"function"!=typeof GM_getValue&&ReportError("This library requires Greasemonkey! GM_getValue is missing."),this.set=function(e,r){if("string"!=typeof e)return void ReportError("Illegal varName sent to GM_SuperValue.set(). Name: "+e+" Value: "+r);switch(/[^\w _-]/.test(e)&&ReportError("Suspect, probably illegal, varName sent to GM_SuperValue.set().  Name: "+e+" Value: "+r),typeof r){case"undefined":ReportError("Illegal varValue sent to GM_SuperValue.set().  Name: "+e+" Value: "+r);break;case"boolean":case"string":GM_setValue(e,r);break;case"number":r===parseInt(r)&&Math.abs(r)<2147483647?GM_setValue(e,r):ReportError("Illegal varValue sent to GM_SuperValue.set().  Name: "+e+" Value: "+r);break;case"object":var a=JSON_MarkerStr+JSON.stringify(r);GM_setValue(e,a);break;case"function":var t=FunctionMarker+r.toString();GM_setValue(e,t);break;default:ReportError("Unknown type in GM_SuperValue.set()! Name: "+e+" DefaultValue: "+r)}},this.get=function(varName,defaultValue){if("string"!=typeof varName)return void ReportError("Illegal varName sent to GM_SuperValue.get(). Name: "+varName+" DefaultValue: "+defaultValue);/[^\w _-]/.test(varName)&&ReportError("Suspect, probably illegal, varName sent to GM_SuperValue.get(). Name: "+varName+" DefaultValue: "+defaultValue);var varValue=GM_getValue(varName);if("undefined"==typeof varValue)return defaultValue;if("string"==typeof varValue){var regxp=new RegExp("^"+JSON_MarkerStr+"(.+)$"),m=varValue.match(regxp);if(m&&m.length>1)return varValue=JSON.parse(m[1]);if(regxp=new RegExp("^"+FunctionMarker+"((?:.|\n|\r)+)$"),m=varValue.match(regxp),m&&m.length>1)return varValue=eval("("+m[1]+")")}return varValue}};