[Greasemonkey] Re: GreaseMonkey 0.3

Aaron Boodman zboogs at gmail.com
Fri Apr 15 09:52:46 EDT 2005

Which version exactly are you using? There was an issue we found quite
early with 0.3 in that it didn't migrate your old scripts. The latest
XPI I sent out, 0.3a does this.

Secondly, just in my own defense, getContents() doesn't die silently,
it throws a javascript error which gets reported to the JS Console in
the typical way. That seems like the correct behavior.

But I hear what your saying - that this is a pretty dreadful situation
which perhaps should be shouted out a little louder.

On 4/15/05, Scott R. Turner <srt at aero.org> wrote:
> I posted a problem I was having yesterday.  I did some more digging
> and figured out what was going on.
> It was something of an unusual situation.  I'm running Win2K with a
> roaming profile, and it looks like my profile only got partially
> updated after installing 0.3.  The effect was that the next time I
> logged in, my scripts got "restored" to the old naming scheme.  As a
> result, Greasemonkey was unable to load the scripts.
> Renaming fixed the problem for me, but it pointed out a more serious
> problem.  As it stands right now if there's an error in loading a
> script, Greasemonkey silently fails, stopping the whole script loading
> in its tracks.  This is probably not the correct behavior :-).
> Here's a quick fix:
> function getContents(aURL){
>    var ioService=Components.classes["@mozilla.org/network/io-service;1"]
>      .getService(Components.interfaces.nsIIOService);
>    var scriptableStream=Components
>      .classes["@mozilla.org/scriptableinputstream;1"]
>      .getService(Components.interfaces.nsIScriptableInputStream);
>    try {
>      var channel=ioService.newChannel(aURL,null,null);
>      var input=channel.open();
>      scriptableStream.init(input);
>      var str=scriptableStream.read(input.available());
>      scriptableStream.close();
>      input.close();
>      return str;
>    } catch (e) {
>      alert("Unable to find the "+aURL+" GreaseMonkey script.  Try re-installing the script.");
>      return "";
>    };
> }
> However, I note this is a problem in the handling of the Edit button,
> and maybe elsewhere as well.
>           -- Scott
> _______________________________________________
> Greasemonkey mailing list
> Greasemonkey at mozdev.org
> http://mozdev.org/mailman/listinfo/greasemonkey

More information about the Greasemonkey mailing list