[Greasemonkey] Removing a script

Stuart Langridge stuart.langridge at gmail.com
Thu Apr 14 18:45:09 EDT 2005

On 4/14/05, Stuart Langridge <stuart.langridge at gmail.com> wrote:
> On 4/14/05, Phil Ringnalda <philringnalda at gmail.com> wrote:
> > Stuart Langridge wrote:
> > > Can I make
> > > the userscript run earlier, so that it removes the <script> element before
> > > it is parsed and the indicated script is loaded?
> >
> > I suppose you would run into cross-site problems if you just removed the
> > script element from the DOM, added a <base href>, and then serialized
> > getElementsByTagName("html")[0].innerHTML into a data: URL that you then
> > load?
> Blimey. I would not have thought of that in a million years. It must
> be something, being inside your head, Phil my man.
> Anyway, it is the mighty infinity of loops, doing this, because once
> the script's run once and loaded the data URI it runs again...fixing
> that now...

It works. Have to have an explicit check inside the user script to
make sure that it doesn't run forever (not sure why it was doing
that). Now to remove all the script URLs and replace them with working
ones. It would actually probably be easier to just go and find the
developers who made this IE-only web app (and charged us a fortune for
it) and have them all boiled in oil, perhaps.


More information about the Greasemonkey mailing list