[Greasemonkey] force writing of prefs.js? - GM_setValue

Roderick McGuire mcguire at telerama.com
Mon Apr 3 13:20:42 EDT 2006


Is there any way to force writing of prefs.js?

Greasemonkey uses prefs.js to implement GM_setValue, and prefs.js only 
seems to be written when firefox exits.

If I've been running firefox for a while with scripts making a lot of 
GM_setValue updates, they all are lost if firefox crashes.

Maybe add a function like GM_synchValues, and recommend that it be used 
sparingly. Or maybe GM could keep track of whether a script has changed 
any values and automatically synch the values when they have been 
quiescent for say 1 minute.

Is there just one version of GM_setValue that all scripts share, or does 
each script run its own copy of GM_setValue?



More information about the Greasemonkey mailing list