[Greasemonkey] Installing a user script via a data: url

Aaron Boodman zboogs at gmail.com
Fri Apr 8 18:06:27 EDT 2005


Ok.

One thing you may want to think about. When I get to injecting scripts
earlier into moz, I was thinking of adopting a syntax like this: (I
think it was Bill Donnelly who first suggested it).

//=== @locationAfter <head> ===

script to be injected after the opening head tag goes here  ....

//=== @locationBefore </body> ===

script to be injected before the closing body tag goes here ...

//=== @locationReplace /<body>.*?</body>/n ===

script to replace the entire body goes here ...

This will allow authors to be able to do things they cannot do today
becaise they don't get injected early enough, or at the specific time
they need to. Sorta like a poorman's HTML overlays. (can't do real
overlays because we have no DOM at this early stage).

It seems closely related to what you are working on, right?


On Apr 8, 2005 4:37 PM, Julien Couvreur <julien.couvreur at gmail.com> wrote:
> Tony says:
> > But when you select "install user script" and confirm the install,
> > greasemonkey downloads the page again rather than using what's showing.
> > As it downloads the page, it loses the javascript generated code.  I
> > imagine the same problem exists for base64 encoded scripts.
> 
> I had GreaseMonkey install from a loaded data: page with no problem
> (with the patch to enabled the "Install User Script" in the "Tools"
> menu). I haven't tried from a data: link.
> 
> Aaron says: "Compliments on your system; my head just about exploded
> when I decoded a script and saw that it, itself, contained an encoded
> image ;-)."
> 
> Hehe, thanks. It twisted my head too ;-)
> 
> I'm not sure what the size limit is on data: urls, but it seems like
> it can fit a lot.
> 
> If you can checkin the change that we discussed (enabling the install
> from the menu for loaded data: pages, but not from the context menu
> for data: links) I'll work some more on the script generation page (to
> make it nicer and more usable).
> I think the need for customized scripts is important. See for example
> http://www.customizegoogle.com/ (but it relies on the server to
> generate the user script...).
> 
> I have another script generation page in mind: a general text matching
> to link (like a simple AutoLink). You would specify the patterns for
> ISBN (using a regex) and put some html to have it go to amazon. Same
> for UPS/Fedex/...
> 
> Cheers,
> Julien
> _______________________________________________
> Greasemonkey mailing list
> Greasemonkey at mozdev.org
> http://mozdev.org/mailman/listinfo/greasemonkey
>


More information about the Greasemonkey mailing list