Discussion:
Greasemonkey 0.3
Aaron Boodman
2005-04-11 07:22:32 UTC
Permalink
Spent a little while getting all the changes I've been working on
separately consolidated into one big release.

Here's what this includes:

New
========================================
* local data persistence - see below
* added an edit button to manage dialog
* traded enable all/disable all buttons in manage dialog for an
enable/disable greasemonkey icon in the bottom right corner of
browser. Some users wanted this to be able to enable and disable GM
quickly.
* GM_log(message)
* added support for data urls (not for context menu though)
* works in FF 1.0.3 (some scripts need updates though, more below)
From 0.2.7b
========================================
* scoped GM_* down to user scripts only
* clipped user script names in manage screen with elipsises so that
they cannot push the install button off the window
* improved error handling; isolating scripts errors from each other

Data Persistence
========================================
* GM_setValue(name, value)
value can be a string, boolean, integer, or null. Other types will
throw an error.
* GM_getValue(name, default)
if value doesn't exist, default will be returned. If default is not
specified, undefined will be returned.

FF 1.0.3 breaks scripts that use window._content
========================================
The undocumented, unsupported window._content property on the
content's window object has disappeared in 1.0.3 breaking a few user
scripts which were using it.

The funny thing is that window._content just resolved to window. So it
was totally unnecessary.

The scripts I ran into which do this were google image relinker and
all music guide corrector. These scripts, and any others which did
this, should replace references to window._content with just window.
Aaron Boodman
2005-04-11 07:45:20 UTC
Permalink
Forgot to mention one rather important thing.

To support the new edit button, I changed the configuration format
slightly. This has been the first such change since greasemonkey was
released.

I got rid of the ID attribute in the config file and replaced it with
a filename attribute. When you download files now, I come up with a
unique (in the scope of files you've already installed) name for it,
based on the scripts actual name, and append ".user.js". That way,
when the file is launched from clicking the edit button, your OS does
the right thing for javascript files.

What this means to you: If you want to keep your current user script
configuration, follow these instructions:

* Before installing, back up your current {profile
dir}\extensions\{e4a8a97b-f2ed-450b-b12d-ee082ba24781}\chrome\greasemonkey\content\scripts
folder.
* Install GM 0.3
* navigate to the scripts folder, open config.xml
* replace all instances of id="somenumber" in the file with
filename="somenumber.user.js".
* rename all the numbered files in the scripts folder with the
extension ".user.js" so that they correspond with the changes made in
the config file.
* If you screw up, restore from the backup you made in the first step
and try again :)

Sorry, I totally forgot about this till I sent the last mail. I might
have to come up with a script that does this as part of the install or
something.
--
Aaron
Post by Aaron Boodman
Spent a little while getting all the changes I've been working on
separately consolidated into one big release.
New
========================================
* local data persistence - see below
* added an edit button to manage dialog
* traded enable all/disable all buttons in manage dialog for an
enable/disable greasemonkey icon in the bottom right corner of
browser. Some users wanted this to be able to enable and disable GM
quickly.
* GM_log(message)
* added support for data urls (not for context menu though)
* works in FF 1.0.3 (some scripts need updates though, more below)
From 0.2.7b
========================================
* scoped GM_* down to user scripts only
* clipped user script names in manage screen with elipsises so that
they cannot push the install button off the window
* improved error handling; isolating scripts errors from each other
Data Persistence
========================================
* GM_setValue(name, value)
value can be a string, boolean, integer, or null. Other types will
throw an error.
* GM_getValue(name, default)
if value doesn't exist, default will be returned. If default is not
specified, undefined will be returned.
FF 1.0.3 breaks scripts that use window._content
========================================
The undocumented, unsupported window._content property on the
content's window object has disappeared in 1.0.3 breaking a few user
scripts which were using it.
The funny thing is that window._content just resolved to window. So it
was totally unnecessary.
The scripts I ran into which do this were google image relinker and
all music guide corrector. These scripts, and any others which did
this, should replace references to window._content with just window.
Edward Lee
2005-04-11 07:50:05 UTC
Permalink
Post by Aaron Boodman
Forgot to mention one rather important thing.
Aha! I was just about to report that edit doesn't work on old scripts
and installing the same script over the old script doesn't work either
(if you click ok, it does nothing).
--
Ed
Tycho Quad
2005-04-11 07:52:45 UTC
Permalink
Will this release work on the trunk?
Aaron Boodman
2005-04-11 08:08:55 UTC
Permalink
Hm, I got 'trunck' confused with 'nightlies', and they aren't the same
thing, are they. I'll have to check that.
Post by Tycho Quad
Will this release work on the trunk?
_______________________________________________
Greasemonkey mailing list
http://mozdev.org/mailman/listinfo/greasemonkey
Tycho Quad
2005-04-11 08:33:06 UTC
Permalink
At the moment, the trunk is the nightlies, but it's not always the case.
Sometimes there are nightlies created off branches, such as the 1.0.3
release candidates, and most of the nightly builds just before the
release of 1.0.

At the moment, I'm referring to the nightly builds of firefox which are
made from the trunk, info on such builds can usually be found in threads
like this: http://forums.mozillazine.org/viewtopic.php?t=248670

I hope I've been of some help :P
Post by Aaron Boodman
Hm, I got 'trunck' confused with 'nightlies', and they aren't the same
thing, are they. I'll have to check that.
Post by Tycho Quad
Will this release work on the trunk?
_______________________________________________
Greasemonkey mailing list
http://mozdev.org/mailman/listinfo/greasemonkey
_______________________________________________
Greasemonkey mailing list
http://mozdev.org/mailman/listinfo/greasemonkey
Michael Bierman
2005-04-11 20:04:56 UTC
Permalink
Here's what I've noticed:

1. The Script names still don't scale vertically (only horizontally).

2. I followed the procedures outlined, and my user scripts appear, but a)
edit only opens the directory, not the JS file so I have to guess as to
which one it is. B) my user scripts don't seem to be working anymore. :(

3. Escape doesn't close the entire Manage User Scripts window. I think it
should = Cancel.

-----Original Message-----
From: Aaron Boodman

Forgot to mention one rather important thing.


Sorry, I totally forgot about this till I sent the last mail. I might have
to come up with a script that does this as part of the install or something.

MB> That would be great. Perhaps once you have some of the other things
worked out though? ;)

--
Aaron
Aaron Boodman
2005-04-11 20:29:52 UTC
Permalink
Post by Michael Bierman
1. The Script names still don't scale vertically (only horizontally).
I don't know what you mean by this.
Post by Michael Bierman
edit only opens the directory, not the JS file so I have to guess as to
which one it is.
That sucks. What OS do you use? Can you zip the contents of your
scripts dir and send it to me?
Post by Michael Bierman
B) my user scripts don't seem to be working anymore. :(
You should have some errors in JS Console? What are they?
Post by Michael Bierman
3. Escape doesn't close the entire Manage User Scripts window. I think it
should = Cancel.
Definitely. This is an old, annoying bug.

Thanks for the feedback.
Michael Bierman
2005-04-11 20:50:52 UTC
Permalink
-----Original Message-----
From: Aaron Boodman
Post by Michael Bierman
1. The Script names still don't scale vertically (only horizontally).
I don't know what you mean by this.

MB> This is the bug we've talked about before. The area where the user
script names are doesn't expand up and down, only left and right.
Post by Michael Bierman
edit only opens the directory, not the JS file so I have to guess as
to which one it is.
That sucks. What OS do you use? Can you zip the contents of your scripts dir
and send it to me?

MB> WinXP SP2. I'll send you the Zip file separately.
Post by Michael Bierman
B) my user scripts don't seem to be working anymore. :(
You should have some errors in JS Console? What are they?

MB> None. When I uninstall, restart, restore original scripts directory,
reinstall .26 everything is fine.

Michael
Mark Pilgrim
2005-04-11 21:25:35 UTC
Permalink
Post by Michael Bierman
Post by Michael Bierman
edit only opens the directory, not the JS file so I have to guess as
to which one it is.
That sucks. What OS do you use? Can you zip the contents of your scripts dir
and send it to me?
MB> WinXP SP2. I'll send you the Zip file separately.
Does the full path to your script contain a space (i.e. does its
folder or any of its parent folders contain a space)?
--
Cheers,
-Mark
Michael Bierman
2005-04-11 21:40:23 UTC
Permalink
-----Original Message-----
From: Mark Pilgrim

Does the full path to your script contain a space (i.e. does its folder or
any of its parent folders contain a space)?

Path is:
C:\Documents and Settings\Michael\Application
Data\Mozilla\Firefox\Profiles\kjbe7do8.default\extensions\{e4a8a97b-f2ed-450
b-b12d-ee082ba24781}\chrome\greasemonkey\content\scripts
Edward Lee
2005-04-11 22:04:00 UTC
Permalink
Post by Michael Bierman
2. I followed the procedures outlined, and my user scripts appear, but a)
edit only opens the directory, not the JS file so I have to guess as to
which one it is.
That happened to me when I just installed the new version (before this
migration message came out). When you say you have to guess which one
it is, you're probably refering to the old way of storing them as
filenames with a bunch of numbers. That's probably because the scripts
aren't being updated to the new filename format. I went through and
opened each of the numbered files and renamed them to be the script
name.user.js and updated the config.xml and everything seems to be
working correctly.
--
Ed
Michael Bierman
2005-04-11 22:36:20 UTC
Permalink
No, I mean that the directory opens and then nothing. No file is opened at
when I click on edit.

I have renamed the files in config.xml andin the scripts themselves. I
already sent Adam my scripts dir.

Michael


-----Original Message-----
From: greasemonkey-***@mozdev.org
[mailto:greasemonkey-***@mozdev.org] On Behalf Of Edward Lee
Sent: Monday, April 11, 2005 3:04 PM
To: ***@mozdev.org
Subject: Re: [Greasemonkey] Re: Greasemonkey 0.3 - ugh,migration - read this
before installing 0.3
Post by Michael Bierman
2. I followed the procedures outlined, and my user scripts appear, but
a) edit only opens the directory, not the JS file so I have to guess
as to which one it is.
That happened to me when I just installed the new version (before this
migration message came out). When you say you have to guess which one it is,
you're probably refering to the old way of storing them as filenames with a
bunch of numbers. That's probably because the scripts aren't being updated
to the new filename format. I went through and opened each of the numbered
files and renamed them to be the script name.user.js and updated the
config.xml and everything seems to be working correctly.

--
Ed
Aaron Boodman
2005-04-11 22:58:43 UTC
Permalink
Adam
It's "Aaron" :)
Michael Bierman
2005-04-11 23:01:10 UTC
Permalink
DOH! My apologies.

Michael

-----Original Message-----
From: greasemonkey-***@mozdev.org
[mailto:greasemonkey-***@mozdev.org] On Behalf Of Aaron Boodman
Sent: Monday, April 11, 2005 3:59 PM
To: ***@mozdev.org
Subject: Re: [Greasemonkey] Re: Greasemonkey 0.3 - ugh,migration - read this
before installing 0.3
Adam
It's "Aaron" :)
Jeremy Dunck
2005-04-11 23:00:50 UTC
Permalink
Post by Michael Bierman
already sent Adam my scripts dir.
Err, Aaron. The guy's a coding whirlwind. Let's get his name right. ;-)
Edward Lee
2005-04-11 07:59:07 UTC
Permalink
Any reasoning behind the characters and number of characters for the
new file name? Mostly wondering about the toLower. Oh and probably
could just use \W dropping the caseless matching, but maybe your way
is more efficient (reduces quite a few cases..)?

var base = script.name.replace(/[^A-Z0-9_]/gi, "").toLowerCase();
base = base.substring(0, 24);
--
Ed
Aaron Boodman
2005-04-11 08:11:23 UTC
Permalink
I was having some trouble with arbitrarily long filenames on mac osx.
I did some searching and couldn't find simple definitions of filenames
that work across modern, popular OS's (NT, osx, and *nix).

So I said to myself "self, 24 is a nice round number". And that was that.

The characters are just those that I trusted to work on all OS's.
You're right, I could just use \w (or \W), I think it is defined as
precisely what I have there. Not sure why I didn't think of it.
Post by Edward Lee
Any reasoning behind the characters and number of characters for the
new file name? Mostly wondering about the toLower. Oh and probably
could just use \W dropping the caseless matching, but maybe your way
is more efficient (reduces quite a few cases..)?
var base = script.name.replace(/[^A-Z0-9_]/gi, "").toLowerCase();
base = base.substring(0, 24);
--
Ed
_______________________________________________
Greasemonkey mailing list
http://mozdev.org/mailman/listinfo/greasemonkey
Mark Pilgrim
2005-04-11 17:40:12 UTC
Permalink
Post by Aaron Boodman
* added an edit button to manage dialog
* traded enable all/disable all buttons in manage dialog for an
enable/disable greasemonkey icon in the bottom right corner of
browser. Some users wanted this to be able to enable and disable GM
quickly.
FYI: I didn't care about my existing script config, so I ignored your
instructions completely and just uninstalled the old one and installed
the new one without mucking about in my profile. When I came up with
the new version and went to Manage User Scripts, it still listed the
three old ones. I selected each in turn and clicked Uninstall, which
appeared to work. Then I clicked OK and nothing happened. I ALT-F4'd
my way out and went back in and the scripts are gone, and the OK
button works again.
--
Cheers,
-Mark
Aaron Boodman
2005-04-11 17:54:37 UTC
Permalink
Yeah I totally did not consider the upgrade path. I am not surprised
that it fails in wierd and wonderful ways.

Probably looking for the filename="" attribute in config.xml and not
finding it if you look in JSConsole.

I will write an auto update into this release.

If you do not care about your config, just delete config.xml (and
optionally all the scripts).

Other than that, what do you think?
Post by Mark Pilgrim
Post by Aaron Boodman
* added an edit button to manage dialog
* traded enable all/disable all buttons in manage dialog for an
enable/disable greasemonkey icon in the bottom right corner of
browser. Some users wanted this to be able to enable and disable GM
quickly.
FYI: I didn't care about my existing script config, so I ignored your
instructions completely and just uninstalled the old one and installed
the new one without mucking about in my profile. When I came up with
the new version and went to Manage User Scripts, it still listed the
three old ones. I selected each in turn and clicked Uninstall, which
appeared to work. Then I clicked OK and nothing happened. I ALT-F4'd
my way out and went back in and the scripts are gone, and the OK
button works again.
--
Cheers,
-Mark
_______________________________________________
Greasemonkey mailing list
http://mozdev.org/mailman/listinfo/greasemonkey
Mark Pilgrim
2005-04-11 18:34:56 UTC
Permalink
Post by Aaron Boodman
Other than that, what do you think?
Looks great, works great, except that the stickies code I had hoped to
port to GM is not as portable it appeared, and it has weird bugs when
grafted on top of existing pages with existing styles and content.
But 0.3 is looking to be everything I ever wanted from Greasemonkey,
so thanks for that.
--
Cheers,
-Mark
Aaron Boodman
2005-04-13 10:32:57 UTC
Permalink
Here's an update which includes migration code from earlier versions.
The first time this version runs, it will convert your scripts
directory to the new format.

It makes a backup first, so don't worry about losing your config.
Please try it out.

If it screws up, send the contents of your JS Console and details of
what went wrong. I want to get this code right before putting it on
the site.

Backups of your old configuration can be found in %tmp%/{largest
integer directory}. Greasemonkey should report the actual path to you
in case of error.
--
Aaron
Post by Mark Pilgrim
Post by Aaron Boodman
Other than that, what do you think?
Looks great, works great, except that the stickies code I had hoped to
port to GM is not as portable it appeared, and it has weird bugs when
grafted on top of existing pages with existing styles and content.
But 0.3 is looking to be everything I ever wanted from Greasemonkey,
so thanks for that.
--
Cheers,
-Mark
_______________________________________________
Greasemonkey mailing list
http://mozdev.org/mailman/listinfo/greasemonkey
Aaron Boodman
2005-04-13 10:34:48 UTC
Permalink
BTW, If anybody ever wants to make a patch (*hint*, *hint*), I think i
found the perfect combination of CVS arguments:

cvs diff -u -N -R -b > ~/tmp/greasemonkey_0.3a.patch

-u unified format. looks nicer (as evan pointed out)
-N new files. include new (also removed) files in diff
-R recursive.
-b no idea. makes the diff not consider whitespace changes.
Post by Aaron Boodman
Here's an update which includes migration code from earlier versions.
The first time this version runs, it will convert your scripts
directory to the new format.
It makes a backup first, so don't worry about losing your config.
Please try it out.
If it screws up, send the contents of your JS Console and details of
what went wrong. I want to get this code right before putting it on
the site.
Backups of your old configuration can be found in %tmp%/{largest
integer directory}. Greasemonkey should report the actual path to you
in case of error.
--
Aaron
Post by Mark Pilgrim
Post by Aaron Boodman
Other than that, what do you think?
Looks great, works great, except that the stickies code I had hoped to
port to GM is not as portable it appeared, and it has weird bugs when
grafted on top of existing pages with existing styles and content.
But 0.3 is looking to be everything I ever wanted from Greasemonkey,
so thanks for that.
--
Cheers,
-Mark
_______________________________________________
Greasemonkey mailing list
http://mozdev.org/mailman/listinfo/greasemonkey
Alf Eaton
2005-04-13 10:50:32 UTC
Permalink
Worked fine here (Firefox 0.3RC, OS X.3). The little monkey made me
laugh too :-)

alf.
Post by Aaron Boodman
Here's an update which includes migration code from earlier versions.
The first time this version runs, it will convert your scripts
directory to the new format.
It makes a backup first, so don't worry about losing your config.
Please try it out.
If it screws up, send the contents of your JS Console and details of
what went wrong. I want to get this code right before putting it on
the site.
Backups of your old configuration can be found in %tmp%/{largest
integer directory}. Greasemonkey should report the actual path to you
in case of error.
--
Aaron
Post by Mark Pilgrim
Post by Aaron Boodman
Other than that, what do you think?
Looks great, works great, except that the stickies code I had hoped to
port to GM is not as portable it appeared, and it has weird bugs when
grafted on top of existing pages with existing styles and content.
But 0.3 is looking to be everything I ever wanted from Greasemonkey,
so thanks for that.
--
Cheers,
-Mark
_______________________________________________
Greasemonkey mailing list
http://mozdev.org/mailman/listinfo/greasemonkey
<greasemonkey_0.3a.xpi><greasemonkey_0.3a.patch>_______________________
________________________
Greasemonkey mailing list
http://mozdev.org/mailman/listinfo/greasemonkey
Jeremy Dunck
2005-04-13 14:42:55 UTC
Permalink
Post by Aaron Boodman
Please try it out.
FF 1.0.2, W2K, upgrading from 0.2.7a, worked dandy!
p***@gmail.com
2005-04-13 15:17:38 UTC
Permalink
Hey Aaron I ran the .xpi ,but i'm not sure how to run the patch
Post by Aaron Boodman
Here's an update which includes migration code from earlier versions.
The first time this version runs, it will convert your scripts
directory to the new format.
It makes a backup first, so don't worry about losing your config.
Please try it out.
If it screws up, send the contents of your JS Console and details of
what went wrong. I want to get this code right before putting it on
the site.
Backups of your old configuration can be found in %tmp%/{largest
integer directory}. Greasemonkey should report the actual path to you
in case of error.
--
Aaron
Post by Mark Pilgrim
Post by Aaron Boodman
Other than that, what do you think?
Looks great, works great, except that the stickies code I had hoped to
port to GM is not as portable it appeared, and it has weird bugs when
grafted on top of existing pages with existing styles and content.
But 0.3 is looking to be everything I ever wanted from Greasemonkey,
so thanks for that.
--
Cheers,
-Mark
_______________________________________________
Greasemonkey mailing list
http://mozdev.org/mailman/listinfo/greasemonkey
_______________________________________________
Greasemonkey mailing list
http://mozdev.org/mailman/listinfo/greasemonkey
Jeremy Dunck
2005-04-13 19:07:57 UTC
Permalink
Hey Aaron I ran the .xpi ,but i'm not sure how to run the patch
The patch is just a file documenting the differences between the files
in this XPI and the last released XPI. It's there for developers; no
need to run/open it if you just want to install the XPI.
Scott R. Turner
2005-04-13 15:35:12 UTC
Permalink
Post by Aaron Boodman
Please try it out.
The migration seemed to work fine, but when I try the "Edit" button I
get a popup error message from "Windows Script Host"

Script: (the one I'm editing)
Line: 10
Char: 3
Error: 'document' is undefined
Code: 800A1391
Source: Microsoft JScript runtime error

I'm running 1.0.2 on Windows 2K Professional.

-- Scott
p***@gmail.com
2005-04-13 15:41:57 UTC
Permalink
Yeha I'm getting that error too
Post by Scott R. Turner
Post by Aaron Boodman
Please try it out.
The migration seemed to work fine, but when I try the "Edit" button I
get a popup error message from "Windows Script Host"
Script: (the one I'm editing)
Line: 10
Char: 3
Error: 'document' is undefined
Code: 800A1391
Source: Microsoft JScript runtime error
I'm running 1.0.2 on Windows 2K Professional.
-- Scott
_______________________________________________
Greasemonkey mailing list
http://mozdev.org/mailman/listinfo/greasemonkey
Ivan Shiel
2005-04-13 15:44:50 UTC
Permalink
You need to change the default application that opens .js files. Just
right click on a .js file in Explorer and click the Change button

Yeah, it caught me out too at first....
Post by Aaron Boodman
Please try it out.
The migration seemed to work fine, but when I try the "Edit" button I
get a popup error message from "Windows Script Host"

Script: (the one I'm editing)
Line: 10
Char: 3
Error: 'document' is undefined
Code: 800A1391
Source: Microsoft JScript runtime error

I'm running 1.0.2 on Windows 2K Professional.

-- Scott
p***@gmail.com
2005-04-13 15:47:51 UTC
Permalink
Thanks :)
You need to change the default application that opens .js files. Just
right click on a .js file in Explorer and click the Change button
Yeah, it caught me out too at first....
Post by Aaron Boodman
Please try it out.
The migration seemed to work fine, but when I try the "Edit" button I
get a popup error message from "Windows Script Host"
Script: (the one I'm editing)
Line: 10
Char: 3
Error: 'document' is undefined
Code: 800A1391
Source: Microsoft JScript runtime error
I'm running 1.0.2 on Windows 2K Professional.
-- Scott
_______________________________________________
Greasemonkey mailing list
http://mozdev.org/mailman/listinfo/greasemonkey
_______________________________________________
Greasemonkey mailing list
http://mozdev.org/mailman/listinfo/greasemonkey
Michael Bierman
2005-04-13 17:27:20 UTC
Permalink
I got this error too and I had set my .js files to open in TextPad. (They
have the TextPad icon and open automatically with it when I double click.
Strangely, after running .3a that association seems to have been lost and I
had to recreate it. Comments? Suggestions?

Good news: Unlike .3, things seem to be working otherwise. (Scripts are
working etc.)

XP SP2 FF 1.0.2

Michael




_____

On 4/13/05, Ivan Shiel <***@barkingstars.com> wrote:

You need to change the default application that opens .js files. Just
right click on a .js file in Explorer and click the Change button

Yeah, it caught me out too at first....
Post by Aaron Boodman
Please try it out.
The migration seemed to work fine, but when I try the "Edit" button I
get a popup error message from "Windows Script Host"

Script: (the one I'm editing)
Line: 10
Char: 3
Error: 'document' is undefined
Code: 800A1391
Source: Microsoft JScript runtime error

I'm running 1.0.2 on Windows 2K Professional.

-- Scott
Aaron Boodman
2005-04-13 19:27:07 UTC
Permalink
Post by Michael Bierman
I got this error too and I had set my .js files to open in TextPad. (They
have the TextPad icon and open automatically with it when I double click.
Strangely, after running .3a that association seems to have been lost and I
had to recreate it. Comments? Suggestions?
That's hard to believe! But I'll look into it. Maybe there's a way in
firefox to access the "edit" contextual command on windows.
Mark Pilgrim
2005-04-13 16:04:27 UTC
Permalink
Post by Ivan Shiel
You need to change the default application that opens .js files.
This tripped me up too, and exact platform-specific instructions
definitely deserve a prominent place in the FAQ.
--
Cheers,
-Mark
Scott R. Turner
2005-04-13 16:23:06 UTC
Permalink
Post by Mark Pilgrim
Post by Ivan Shiel
You need to change the default application that opens .js files.
This tripped me up too, and exact platform-specific instructions
definitely deserve a prominent place in the FAQ.
Huh? That makes no sense.

Hitting "edit" should not bring up the default application. The
default application is for "using" the file, so it correctly should be
the script engine. If anything, the edit button ought to bring up the
default editor pointing to the script file.

-- Scott
Edward Lee
2005-04-13 16:33:39 UTC
Permalink
Post by Scott R. Turner
Hitting "edit" should not bring up the default application. The
default application is for "using" the file, so it correctly should be
the script engine. If anything, the edit button ought to bring up the
default editor pointing to the script file.
At least for me, every time I find a .js file, I would want to edit it
when double clicking it. Windows defaults to running it.. but when
would you run a javascript file, especially one for a user script.
I've never needed to execute a javascript file, so that's why I
changed my default action to be editing in notepad.
--
Ed
Edward Lee
2005-04-13 16:37:25 UTC
Permalink
Post by Scott R. Turner
If anything, the edit button ought to bring up the
default editor pointing to the script file.

Sorry for all the replies.. That is a valid point. With so many people
using Greasemonkey and user scripts, they'll see that Edit button and
click it and get a script runtime error by default on Windows which
could get very annoying. Right now Greasemonkey says to "execute" the
file which will run the default application to handle .user.js -> .js
files.
--
Ed
Aaron Boodman
2005-04-13 16:43:40 UTC
Permalink
Post by Scott R. Turner
Hitting "edit" should not bring up the default application. The
default application is for "using" the file, so it correctly should be
the script engine. If anything, the edit button ought to bring up the
default editor pointing to the script file.
That's another reason I like the extension ".user.js". For the
developers in the hizou, they will probably have *.js associated with
an editor since running a javascript is usually pointless on any
platform.

For those who have associations they like, they can associate
userscripts specifically by associating ".user.js".

In windows, I don't think there is a concept of a "default editor".
Correct me if I'm wrong.

What if I brought up a dialog the first time the edit button was used
that explained the situation? Or does anyone have any bright ideas for
UI? Or maybe I should root around in XPCOM for interfaces to register
extensions? (they might be there since mozilla itself has to do this
on install).
Jeremy Dunck
2005-04-13 19:35:41 UTC
Permalink
Post by Aaron Boodman
In windows, I don't think there is a concept of a "default editor".
Correct me if I'm wrong.
You're not wrong.
Post by Aaron Boodman
What if I brought up a dialog the first time the edit button was used
that explained the situation? Or does anyone have any bright ideas for
UI? Or maybe I should root around in XPCOM for interfaces to register
extensions? (they might be there since mozilla itself has to do this
on install).
I think on the first run, if there's no association to .user.js
(and/or .usr.js), just make one. If there is an existing association,
ask the user what to do. Be quiet after that.

In the FAQ, we could point to the pref tree to change if they answer
wrong and want to revise the answer.
Scott R. Turner
2005-04-14 13:26:30 UTC
Permalink
GreaseMonkey 0.3, running on 1.0.2, gives me this error:

Error: [Exception... "Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIChannel.open]" nsresult: "0x80520012 (NS_ERROR_FILE_NOT_FOUND)" location: "JS frame :: chrome://greasemonkey/content/greasemonkey.js :: getContents :: line 422" data: no]
Source File: chrome://greasemonkey/content/greasemonkey.js
Line: 422

when trying to run my comics aggregator script. The script previously
worked fine.

-- Scott
Scott R. Turner
2005-04-14 13:31:27 UTC
Permalink
Another 0.3 error, when closing a tab:

Error: doc has no properties
Source File: chrome://greasemonkey/content/greasemonkey.js
Line: 34

Looks like GreaseMonkey is being called at some point when a tab is
being closed? Someone else should check this out -- I'm using the
tabbrowser extensions, and it is also having some Javascript errors,
so this might be a side-effect.

-- Scott
Aaron Boodman
2005-04-14 15:21:15 UTC
Permalink
Thanks Scott
Post by Scott R. Turner
Error: doc has no properties
Source File: chrome://greasemonkey/content/greasemonkey.js
Line: 34
Looks like GreaseMonkey is being called at some point when a tab is
being closed? Someone else should check this out -- I'm using the
tabbrowser extensions, and it is also having some Javascript errors,
so this might be a side-effect.
-- Scott
_______________________________________________
Greasemonkey mailing list
http://mozdev.org/mailman/listinfo/greasemonkey
Edward Lee
2005-04-13 16:30:38 UTC
Permalink
Post by Mark Pilgrim
This tripped me up too, and exact platform-specific instructions
definitely deserve a prominent place in the FAQ.
Windows XP: Open up Windows Explorer (WinKey + E) -> Tools -> Folder
Options -> File Types -> Click Extensions to sort alphabetically ->
Find JS and select -> Choose program to open it.

Or easier.. Find a .js file -> Right click -> Open With -> Choose
Program -> Select/Browse a program to use to open the .js file ->
Select "Always use the selected program to open this kind of file" ->
OK
--
Ed
Jeremy Dunck
2005-04-15 05:11:03 UTC
Permalink
Post by Mark Pilgrim
Looks great, works great, except that the stickies code I had hoped to
port to GM is not as portable it appeared,
I just ran across this:
http://forevergeek.com/open_source/greasemonkey_and_webnote.php
...

http://ponderer.org/download/greasemonkey/webnote_gm.user.js

Close enough?
Julien Couvreur
2005-04-15 21:11:50 UTC
Permalink
Post by Jeremy Dunck
http://forevergeek.com/open_source/greasemonkey_and_webnote.php
http://ponderer.org/download/greasemonkey/webnote_gm.user.js
Is it working for you? I haven't managed to create notes with
Ctrl-Atl-N, although the JS console doesn't have any errors...

Cheers,
Julien
Jeremy Dunck
2005-04-15 21:42:18 UTC
Permalink
Post by Julien Couvreur
Post by Jeremy Dunck
http://forevergeek.com/open_source/greasemonkey_and_webnote.php
http://ponderer.org/download/greasemonkey/webnote_gm.user.js
Is it working for you? I haven't managed to create notes with
Ctrl-Atl-N, although the JS console doesn't have any errors...
Commented on his blog.
Eddie S
2005-04-16 10:57:27 UTC
Permalink
I just tried to upgrade 0.3 to 0.3a and ran in to a problem.
I uninstall v0.3 and install 0.3a. During install I got an error so
checked my JS console. The upgrade script seems to have renamed my
script directory to 'frownies.user.js' (that being the name of the
only script that wasn't in the form {number}.user.js)..

I am running Firefox 1.0.2 on win98

Eddie -- http://e26.co.uk
Aaron Boodman
2005-04-16 17:36:53 UTC
Permalink
But what was the problem? Did you get an alertbox saying there was an
error or what?
Post by Eddie S
I just tried to upgrade 0.3 to 0.3a and ran in to a problem.
I uninstall v0.3 and install 0.3a. During install I got an error so
checked my JS console. The upgrade script seems to have renamed my
script directory to 'frownies.user.js' (that being the name of the
only script that wasn't in the form {number}.user.js)..
I am running Firefox 1.0.2 on win98
Eddie -- http://e26.co.uk
_______________________________________________
Greasemonkey mailing list
http://mozdev.org/mailman/listinfo/greasemonkey
Eddie S
2005-04-16 19:10:39 UTC
Permalink
I got an alert box saying there was an error.
It didnt update config.xml with the names it just gave the files. It
didnt know where the scripts were as it renamed the folder. Whenever i
right clicked "add user script" was visable. And generally confused
itself.

After renaming the script folder back to scripts. Updating the
config.xml file it now works again. But a file in the new name.user.js
confused it. Just thought i would let you know.
Post by Aaron Boodman
But what was the problem? Did you get an alertbox saying there was an
error or what?
Post by Eddie S
I just tried to upgrade 0.3 to 0.3a and ran in to a problem.
I uninstall v0.3 and install 0.3a. During install I got an error so
checked my JS console. The upgrade script seems to have renamed my
script directory to 'frownies.user.js' (that being the name of the
only script that wasn't in the form {number}.user.js)..
I am running Firefox 1.0.2 on win98
Eddie -- http://e26.co.uk
_______________________________________________
Greasemonkey mailing list
http://mozdev.org/mailman/listinfo/greasemonkey
_______________________________________________
Greasemonkey mailing list
http://mozdev.org/mailman/listinfo/greasemonkey
Bill Donnelly
2005-04-17 02:37:56 UTC
Permalink
I got a similar error installing .03a,
except it renamed my scripts directory
to ununderline.user.js. (the first
script name listed in the scripts list)

I think the problem is that it is trying
to migrate to the new format even though
it was already done manually.

Also, when I selected the Tools |
Manage User Scripts... menu item,
it didn't do anything.
(because no scripts were installed?
Worked via Extensions dialog Options button.

But the Cancel button doesn't work.
(as reported elsewhere)

So, in config.xml, it changed all of the
script references to:

<Script filename="" name=.....

So, I fixed them manually, and it still tried to
migrate the next time I started FF and it erased
my changes again. Here is the JS error from the
JS Console, which occured after the last logged
message "Greasemonkey: renaming script scripts to linkify.user.js":

Error: [Exception... "Component returned failure code: 0x80520012
(NS_ERROR_FILE_NOT_FOUND) [nsILocalFile.moveTo]" nsresult: "0x80520012
(NS_ERROR_FILE_NOT_FOUND)" location: "JS frame ::
chrome://greasemonkey/content/greasemonkey.js ::
GM_pointThreeMigrate :: line 540" data: no]
Source File: chrome://greasemonkey/content/greasemonkey.js
Line: 540

I looked at the code and it is trying to do it again
because it didn't set the pointThreeMigrated preference.
So I just made the GM_pointThreeMigrate function return
without doing anything. This code needs to be spiffed up some.
It worked when I did the mod.

btw -- that Edit button is a bit odd. (?)
I can see a View script button, but Edit?
Especially for "users". (versus programmers)
(and it didn't work on Millennium Edition, even tho
most things of that nature work -- I think the problem
might be that .JS isn't defaulted to "edit", and
I don't think we want it to be (?) --- because that
would mess up other stuff (?))
Post by Eddie S
I got an alert box saying there was an error.
It didnt update config.xml with the names it just gave the files. It
didnt know where the scripts were as it renamed the folder. Whenever i
right clicked "add user script" was visable. And generally confused
itself.
After renaming the script folder back to scripts. Updating the
config.xml file it now works again. But a file in the new name.user.js
confused it. Just thought i would let you know.
Bill Donnelly
2005-04-17 02:55:53 UTC
Permalink
Actually, it's not working. Just loading. (0.3a)
Now I am getting the following error over and over
in the JS console when I load a document in the
browser window:

Error: [Exception... "Component returned failure code: 0x80004001
(NS_ERROR_NOT_IMPLEMENTED) [nsIChannel.open]"
nsresult: "0x80004001 (NS_ERROR_NOT_IMPLEMENTED)"
location: "JS frame :: chrome://greasemonkey/content/greasemonkey.js ::
getContents :: line 422" data: no]
Source File: chrome://greasemonkey/content/greasemonkey.js
Line: 422

So that's not good.
Any ideas?
Bill Donnelly
2005-04-17 22:21:40 UTC
Permalink
I uninstalled and reinstalled FF 1.0.3 and
Gm 0.3a and that fixed the problem.
Seems to be working okay now.

For those who are irritated by the Open/Save dialog box
not dereferencing shortcuts/links in Windows, here is
a forum that has an answer on how to fix that bug manually.
(STILL not corrected in FF 1.0.3!)

http://forums.mozillazine.org/viewtopic.php?t=228991&postdays=0&postorder=asc&postsperpage=15&start=15
Post by Bill Donnelly
Actually, it's not working. Just loading. (0.3a)
Now I am getting the following error over and over
in the JS console when I load a document in the
Error: [Exception... "Component returned failure code: 0x80004001
(NS_ERROR_NOT_IMPLEMENTED) [nsIChannel.open]"
nsresult: "0x80004001 (NS_ERROR_NOT_IMPLEMENTED)"
getContents :: line 422" data: no]
Source File: chrome://greasemonkey/content/greasemonkey.js
Line: 422
So that's not good.
Any ideas?
Aaron Boodman
2005-04-17 03:00:47 UTC
Permalink
Thanks for the detailed description of the problem, I'll fix this bug.

Looks like your description of the problem is accurate: you had
already manually migrated, but the preference that migration sets was
not there, so it kept trying to migrate.

You could also fix this in your case by adding that prefrence in about.config:

greasemonkey.pointThreeMigrated = true

or whatever it is.
Post by Bill Donnelly
I got a similar error installing .03a,
except it renamed my scripts directory
to ununderline.user.js. (the first
script name listed in the scripts list)
I think the problem is that it is trying
to migrate to the new format even though
it was already done manually.
Also, when I selected the Tools |
Manage User Scripts... menu item,
it didn't do anything.
(because no scripts were installed?
Worked via Extensions dialog Options button.
But the Cancel button doesn't work.
(as reported elsewhere)
So, in config.xml, it changed all of the
<Script filename="" name=.....
So, I fixed them manually, and it still tried to
migrate the next time I started FF and it erased
my changes again. Here is the JS error from the
JS Console, which occured after the last logged
Error: [Exception... "Component returned failure code: 0x80520012
(NS_ERROR_FILE_NOT_FOUND) [nsILocalFile.moveTo]" nsresult: "0x80520012
GM_pointThreeMigrate :: line 540" data: no]
Source File: chrome://greasemonkey/content/greasemonkey.js
Line: 540
I looked at the code and it is trying to do it again
because it didn't set the pointThreeMigrated preference.
So I just made the GM_pointThreeMigrate function return
without doing anything. This code needs to be spiffed up some.
It worked when I did the mod.
btw -- that Edit button is a bit odd. (?)
I can see a View script button, but Edit?
Especially for "users". (versus programmers)
(and it didn't work on Millennium Edition, even tho
most things of that nature work -- I think the problem
might be that .JS isn't defaulted to "edit", and
I don't think we want it to be (?) --- because that
would mess up other stuff (?))
I got an alert box saying there was an error.
It didnt update config.xml with the names it just gave the files. It
didnt know where the scripts were as it renamed the folder. Whenever i
right clicked "add user script" was visable. And generally confused
itself.
After renaming the script folder back to scripts. Updating the
config.xml file it now works again. But a file in the new name.user.js
confused it. Just thought i would let you know.
_______________________________________________
Greasemonkey mailing list
http://mozdev.org/mailman/listinfo/greasemonkey
Matthias Bauer
2005-04-13 22:50:59 UTC
Permalink
On 11.04.2005 09:22 Aaron Boodman wrote:<br>
Post by Aaron Boodman
Spent a little while getting all the changes I've been working on
separately consolidated into one big release.
Could you make the monkey icon open a GM menu or the GM dialog on
right-click? Currently, it just toggles, no matter how you click it.
Seeing how GM and Compact Menu still don't play well, I'd like an easier
way to access the GM functions than going through Tools > Extensions >
GreaseMonkey > Options.


--Matt
Loading...