Created
February 5, 2011 23:35
-
-
Save sizzlemctwizzle/812926 to your computer and use it in GitHub Desktop.
Test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Script1 | |
// @namespace http://test.free.fr | |
// @description Script1 | |
// @include * | |
// ==/UserScript== | |
window.func = function(getter, setter) { | |
var val = getter('val'); | |
++val; | |
GM_setValue('val', val); | |
++val; | |
setter('val', val); | |
return GM_getValue; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Script2 | |
// @namespace http://test.free.fr | |
// @description Script2 | |
// @include * | |
// ==/UserScript== | |
var val = 1; | |
GM_setValue('val', val); | |
var getter = func(GM_getValue, GM_setValue); | |
alert(val + " + " + getter('val') + " = " + GM_getValue('val')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment