[Greasemonkey] Special casing data: URIs

Mook mook.moz at gmail.com
Thu Apr 14 17:40:02 EDT 2005


Well, it seems to work for me :)

Original code was from:
http://www.mozdev.org/pipermail/greasemonkey/2005-April/000885.html

Modified version (do not use base 64 encoding):
http://home.kimo.com.tw/mook_moz/GreaseMonkeyScriptGenerator.html

The only relevant difference is in makeDataUrl()

On 4/14/05, Aaron Boodman <zboogs at gmail.com> wrote:
> I proposed such a URL hack before and got the responses I got back
> seemed like it was not possible.
> 
> Can somebody mock up a test case that shows that it is indeed
> possible. If so, I'd be happy to remove it.
> 
> On 4/14/05, Mook <mook.moz at gmail.com> wrote:
> > Hi,
> >
> > (Sorry for not replying to the original message - I was not a subscriber)
> >
> > I am proposing dropping special support for data: URIs, since not all
> > of them are user scripts.  Instead, the URIs themselves can be fixed
> > up:
> >
> > 1. Append the string "//.user.js" to the end of the script.  This is
> > treated as a JavaScript comment.
> >
> > 2. Do not use base-64 encoding (btoa()); use encodeURI() instead.
> > This will not munge the last bit of text, so the URI actually will end
> > in .user.js  (Also has the side effect of making the URI longer, but
> > more readable - may hit a URI length limit, however)
> >
> > I don't like assuming all data: URIs are user scripts, that's all.
> > Feel free to ignore me of course - just a random bystander here :)
> >
> > Too bad base64 does not have the dot (.) as a valid character... :p
> >
> > --
> > Mook
> > mook.moz at gmail
> > _______________________________________________
> > Greasemonkey mailing list
> > Greasemonkey at mozdev.org
> > http://mozdev.org/mailman/listinfo/greasemonkey
> >
> _______________________________________________
> Greasemonkey mailing list
> Greasemonkey at mozdev.org
> http://mozdev.org/mailman/listinfo/greasemonkey
> 


-- 
Mook
mook.moz at gmail


More information about the Greasemonkey mailing list