[Greasemonkey] When is a user script too complex? (was: ANN:
Chicago Transit ...)
shooz at mm.st
Tue Apr 19 13:26:44 EDT 2005
Mark Pilgrim wrote:
> At this point you should bite the bullet and create a full-fledged
> extension. You get the benefit of being able to store as many local
> files as you like, in their original format, plus the infrastructure
> of auto-updating, feedback/ratings in the Mozilla Extensions Room, and
> so forth.
I've debated this with a friend of mine -- when should a user script be
a full fledged extension? The best we could come up with is that if
your user script has its own UI that is created in the DOM of the
current page, you've probably outgrown user script-hood. However, the
need for external resources is a pretty good indication that your user
script might be a candidate for an extension as well.
In the short time that Greasemonkey has been around, we've seen more
user scripts created than Firefox extensions (well, that's just a guess,
but it is probably true). This, of course, is due to the low barrier of
entry for creating a user script. Should we not give people the tools
to support advanced features when their user scripts grow in complexity?
That said, I think I'm in the "a user script must be a single file"
camp. However, I do feel strongly that GM should provide a standard way
to embed and access "heredoc" type strings in the script itself. GM may
even feel free to break these chunks out into individual files when the
user script is installed/updated.
Allowing multiple files in a user script and distributing it as an
archive isn't that far of a leap -- but I think it ruins the simplicity
of the whole thing. Having to package things up for distribution is a
pain. Not being able to view the source of the user script in your
browser before installation isn't fun. However, this would provide a
clean way to distribute and maintain the more complex user scripts.
More information about the Greasemonkey