[Greasemonkey] GM_setValue, getValue and default values for preferences

Ori Avtalion oavtal at bezeqint.net
Sun Sep 18 23:54:01 EDT 2005


on 18/09/2005 21:12 Aaron Boodman wrote:
 > On 9/18/05, Ori Avtalion <oavtal at bezeqint.net> wrote:
 >> Also, perhaps GM script-created values should register themselves as
 >> "removable", so users could remove them from about:config by hand (a
 >> firefox RFE is in order before that happens).
 >
 > Excuse my ignorance. This part of the preferences API was always
 > really difficult for me to understand. If we do this, in isolation, it
 > will fix the problem, right?
 >

Well, they can't register themselves as removable (by hand using the 
GUI). There's no such thing yet. I was suggesting it should be proposed 
as a firefox feature, but it's out of the focus of this list.

The isolated GM-only solution, as I see it, is to expose the third 
parameter of setValue in GM_setValue (defaultValue).
Also, if it's called without defaultValue, it should be called with an 
empty value - exposing the value isn't just a fix, but could be used by 
devs to give meaningful default values to their "global vars".

Of course, all of these actions should be taken if it's important to 
prevent GM crashes when users mess with about:config (I think it is).

Parallely, I'm filing a firefox bug about it, to prevent the crash even 
without the GM change. I'll keep the list updated on the progress.

Ori


More information about the Greasemonkey mailing list