greasemonkey/greasemonkey — Issue #1470: Refactor scripticon/scriptresource/scriptrequire
Author: arantius
Created: 2011-11-14 17:54:24+00:00
State: open

These three files/classes are currently a confusing mix of prototype assignments among the three. For example:

...
ScriptIcon.prototype = new ScriptResource();
...
ScriptResource.prototype._initFile = ScriptRequire.prototype._initFile;
...

Plus a variety of confusing reimplementation of similar logic in various places. It would also be nice to turn these into proper JS modules.

My current best idea is to define a base ScriptDependency, which implements all the common logic. Then implement these three on top of that.

This is somewhat related to #1458 but only peripherally. It may get merged together, as I'm trying to separate concerns there. E.G. these dependency objects shouldn't be concerned with how they get downloaded, the code about downloading files should do that.