[Greasemonkey] Cross-script configuration data sharing

Johan Sundström oyasumi at gmail.com
Fri Jan 6 19:31:17 EST 2006


I keep ending up marrying user scripts to be able to have two or more
different scripts work on the same GM_getValue / GM_setValue data
sets. Is there anything in the works for sharing such script
configuration data among different scripts?

If not, I think I'd want to be able to mark data sharing policy with
some additional argument(/-s) to GM_setValue, default behaviour if
unprovided (or zero) as today. A bit field, perhaps, with a set of
flags for (separately) offering other scripts read and write access to
the data?

  GM_setValue( name, value, GM_READ_ACCESS | GM_WRITE_ACCESS );

Some similar addition to GM_getValue to (optionally) denote an owner
script would be needed too, i e:

  GM_getValue( name, namespace, scriptname );

Marrying scripts tends to make some rather unwieldy, huge beasts
offering very counter intuitive feature set combinations. Most of all
though, this is a problem with script names and docs.

Names, because changing a name to fit what a script does, will change
the id:s above, so the new script won't find the data set in previous
versions of the script, prior to the renaming. Also, names grow too
long to be made any sense of for a user.

Docs, because explaining what a script does gets unwieldy when from
all practical perspectives it is really two, or five, or twelve,
different tools bundled into one melding pot.

--
 / Johan Sundström, http://ecmanaut.blogspot.com/


More information about the Greasemonkey mailing list