[Greasemonkey] replacing a script with my own
Rod McGuire
mcguire at telerama.com
Wed Sep 13 14:28:06 EDT 2006
Quoting jjazz <jvasile at gmail.com>:
> I frequent a website that loads a script in the head section with
>
> <script type="text/javascript" src="review.js"></script>
>
> I would like Greasemonkey to get in there and replace review.js with another
> url-- i.e. one that points to my customized version.
You might be able to use the extensions AdBlock or AdBlock Plus to block the
script from being loaded (though I have no experience doing this). Then just
use a normal GM script to do what you want.
For a pure GM approach, GM would have to be augmented with a service that does
patternmatching and replacement on the HTML before it is parsed (this is how I
think AdBlock(+) works), and some way for a user.js script to declare these
replacements. This wouldn't be such a big addition since there would be no need
for a user interface to these replacement patterns.
More information about the Greasemonkey
mailing list