I'm trying to set data in long-term storage in a GreaseMonkey script, except that GM_setValue() seems to fail silently:
$("a#linkid").click(function()
{
GM_setValue("foo", 123); // doesn't work, but does not generate error
});
GM_setValue("bar", 123); // works properly, value is set
I had the same kind of problem...
Previous solution was not working for me and I found solution like this...
You can use this solution.
I think this is a specific Greasemonkey security issue. Please see 0.7.20080121.0 compatibility. GM does not allow user pages to call GreaseMonkey APIs, and that's what you're doing there (you're registering a click handler with JQuery running in the user context). A workaround is also given on that page.