[Greasemonkey] Is better persistent storage needed?

Nikolas 'Atrus' Coukouma lists at atrus.org
Thu May 5 22:47:36 EDT 2005

I'm a bit concerned about user scripts pounding the prefs system using
GM_setValue. The Firefox preferences system usually handles 300-400
settings and does pretty well for itself. I'm not sure how well it's
going to scale if people start storing per-site preferences for their
userscripts and I seem to vaguely recall that some do. As far as I know,
all the prefs are loaded at start from user.js and float about in memory
all the time.

I see a few options:
1) Avoid storing per-site data at all (not a solution, really. are
people doing this?)
2) Create GM storage specifically for per-site data (similar to saved
form data, passwords, etc.)
3) Write a more robust and flexible storage system (e.g. a lightweight

If per-site prefs are being used, with good reason, I'd like to see
option two.

Actually, it might be nice to provide some simple caching so scripts
don't pound sites so much. Maybe authors should just be careful or setup
a proxy webservice (e.g. a central site could scrape info for Book Burro
and cache it).

I think the third probably shouldn't happen. If you want serious data
storage, you can write a web service and grab data from it via
GM_xmlhttpRequest. Decentralization is nice and all, but in this case
it's silly to expect a FF plugin to do it for you. If people don't want
to have their info pass though a central location, I suggest making the
service open source and calling it a day.

-Nikolas 'Atrus' Coukouma

More information about the Greasemonkey mailing list