[Greasemonkey] GM_setValue, getValue and default values for preferences

Ori Avtalion oavtal at bezeqint.net
Mon Sep 19 01:13:59 EDT 2005


on 18/09/2005 22:54 Ori Avtalion wrote:
> 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.

A little correction. This is not a firefox bug. While writing a 
testcase, I noticed that every time a default value that was not set 
with setValue() is requested (after reseting the property by hand), an 
error is returned.

see GetChar/Bool/IntPref at 
http://lxr.mozilla.org/mozilla1.8/source/modules/libpref/src/prefapi.cpp#402 
- NS_ERROR_UNEXPECTED is returned *explicitly*.

I'll submit a default-value wrapper patch for GM this week (it may wait 
till the weekend, though).

On a related note, why not add extra meta-data to greasemonkey scripts
that will have a set of functions to perform on script uninstall. for 
example, clearing script-created variables (no GUI available for that). 
I think I saw it mentioned once in the mailing list/blog.

Ori


More information about the Greasemonkey mailing list