[Greasemonkey] Re: Greasemonkey Digest, Vol 5, Issue 80

Matt Labrum darktempler at gmail.com
Wed Apr 20 21:00:37 EDT 2005


I just realized that the Opera user scripts CAN do that:
http://www.opera.com/support/tutorials/userjs/examples/#loadingscripts

This is exactly the case of mess.be: fixing an ugly script run at page load.

There should be a way with Greasemonkey to define a script to be run
BEFORE any other on the page. For the moment, we can fix the onLoad
scripts from GM but not other scripts at the same level as GM. Pretty
sad.

Eric.


-------------------------
Maby there should be a way to define when we want our script to
excucute something like
GM_loadposition = 9; 

and 9 could mean "before all scripts and before page head is excuted"
(to beat redirects)  and 0 could mean how it is now

On 4/20/05, greasemonkey-request at mozdev.org
<greasemonkey-request at mozdev.org> wrote:
> Send Greasemonkey mailing list submissions to
>         greasemonkey at mozdev.org
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://mozdev.org/mailman/listinfo/greasemonkey
> or, via email, send a message with subject or body 'help' to
>         greasemonkey-request at mozdev.org
> 
> You can reach the person managing the list at
>         greasemonkey-owner at mozdev.org
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Greasemonkey digest..."
> 
> 
> Today's Topics:
> 
>    1. Re: user script --> extensions (Mark Pilgrim)
>    2. Re: Error trying to install GM 0.2.6 from the website
>       (Matthias Bauer)
>    3. (no subject) (Geir Thorud)
>    4. Image maps in JS (Geir Thorud)
>    5. Re: Image maps in JS (Edward Lee)
>    6. Opera 8 User JavaScript (Edward Lee)
>    7. Re: Opera 8 User JavaScript (Jeremy Dunck)
>    8. Re: Opera 8 User JavaScript (Aaron Boodman)
>    9. Re: (no subject) (Mark Pilgrim)
>   10. Re: Opera 8 User JavaScript (Mark Pilgrim)
>   11. Re: (no subject) (Jeremy Dunck)
>   12. Re: Greasemonkey Digest, Vol 5, Issue 79 (Matt Labrum)
>   13. Re: Choosing the right script (Eric Darchis)
> 
> 
> 
> ---------- Forwarded message ----------
> From: Mark Pilgrim <pilgrim at gmail.com>
> To: greasemonkey at mozdev.org
> Date: Tue, 19 Apr 2005 20:25:18 -0400
> Subject: Re: [Greasemonkey] user script --> extensions
> On 4/19/05, Julien Couvreur <julien.couvreur at gmail.com> wrote:
> > 2) Another approach that I haven't seen yet would be to hook up in the
> > web site's preference page, or add your own "Google Butler preference"
> > link. In your case, you could add options to the Google preference
> > page: http://www.google.com/preferences?hl=en
> 
> I link this idea the best, although an explicit link (perhaps in the
> "enhanced by Butler" banner) to the preference page would make it more
> explicit.
> 
> I'd still love to see a Greasemonkey --> browser extension migration
> tool, though.
> 
> --
> Cheers,
> -Mark
> 
> 
> 
> ---------- Forwarded message ----------
> From: Matthias Bauer <ml-greasemonkey-42imk83y at moeffju.net>
> To: greasemonkey at mozdev.org
> Date: Wed, 20 Apr 2005 02:43:43 +0200
> Subject: Re: [Greasemonkey] Error trying to install GM 0.2.6 from the website
> On 19.04.2005 19:37 Aaron Boodman wrote:
> 
> > Typically, the extension does actually install even though it gives
> > that error. Tell your friend to restart the browser after receiving
> > this message and double-check that the extension hasn't - in fact -
> > installed.
> 
> No go after browser restarts. A reboot worked magic, though, so it
> eventually just worked. Windows is weird like that, I suppose.
> 
> -Matt
> 
> 
> 
> ---------- Forwarded message ----------
> From: "Geir Thorud" <geir.thorud at chello.no>
> To: <greasemonkey at mozdev.org>
> Date: Wed, 20 Apr 2005 02:52:26 +0200
> Subject: [Greasemonkey] (no subject)
> Hi,
> 
> This is probably not the correct list for this,
> but I give it a try.
> 
> I want to use GM to modify an image map, i.e.
> add new areas, change the location of existing areas
> and add JS functions to be executed when an area is
> clicked.
> 
> I have spent the evening trying to find out how
> to find and manipulate the objects representing
> the map and areas in JS.
> 
> Does anyone know where I can find reference docs
> or examples on the web? Or any other sugestions?
> 
> Thanks,
> 
> Geir Thorud
> 
> 
> 
> ---------- Forwarded message ----------
> From: "Geir Thorud" <geir.thorud at chello.no>
> To: <greasemonkey at mozdev.org>
> Date: Wed, 20 Apr 2005 02:55:22 +0200
> Subject: [Greasemonkey] Image maps in JS
> Hi,
> 
> This is probably not the correct list for this,
> but I give it a try.
> 
> I want to use GM to modify an image map, i.e.
> add new areas, change the location of existing areas
> and add JS functions to be executed when an area is
> clicked.
> 
> I have spent the evening trying to find out how
> to find and manipulate the objects representing
> the map and areas in JS.
> 
> Does anyone know where I can find reference docs
> or examples on the web? Or any other sugestions?
> 
> Thanks,
> 
> Geir Thorud
> 
> 
> 
> ---------- Forwarded message ----------
> From: Edward Lee <edilee at gmail.com>
> To: greasemonkey at mozdev.org
> Date: Tue, 19 Apr 2005 20:11:23 -0500
> Subject: Re: [Greasemonkey] Image maps in JS
> On 4/19/05, Geir Thorud <geir.thorud at chello.no> wrote:
> > I want to use GM to modify an image map, i.e.
> > add new areas, change the location of existing areas
> > and add JS functions to be executed when an area is
> > clicked.
> 
> I haven't played around with map/areas too much, but taking a quick
> look through the dom inspector.. you should be able to access the map
> and its area tags just like any other node. The area nodes have
> attributes that you'll probably want to modify such as coords and
> href. For the javascript, you can either set the href to be
> "javascript:..." or add an onclick eventlistener to the area.
> 
> var a = document.createElement('area');
> a.coords = '0,0,100,100';
> a.href = '/';
> document.getElementsByTagName('map')[0].appendChild(a);
> 
> Assuming the map is already there, that code will create a new area in
> the upper left corner that links back to the root.
> 
> --
> Ed
> 
> 
> 
> ---------- Forwarded message ----------
> From: Edward Lee <edilee at gmail.com>
> To: greasemonkey at mozdev.org
> Date: Tue, 19 Apr 2005 21:06:53 -0500
> Subject: [Greasemonkey] Opera 8 User JavaScript
> It seems like Opera 8 has added quite a bit of support for
> greasemonkey user scripts out of the box. Should user script
> developers try to make sure that their scripts work correctly in both
> firefox and opera? I wonder how much they actually implemented..
> GM_functions?
> 
> http://www.opera.com/support/tutorials/userjs/examples/#greasemonkey
> 
> Greasemonkey scripts
> 
> Opera is capable of running many Greasemonkey scripts. These are
> JavaScripts designed to work with the Greasemonkey enhancement for the
> Mozilla browser family. To tell Opera that a script file uses
> Greasemonkey notation, the name of the file containing the script must
> end with .user.js (all other .js files are assumed to be normal User
> JavaScripts). Scripts that use Greasemonkey notation are handled
> slightly differently (in order to be compatible with existing
> scripts):
> --
> Ed
> 
> 
> 
> ---------- Forwarded message ----------
> From: Jeremy Dunck <jdunck at gmail.com>
> To: greasemonkey at mozdev.org
> Date: Tue, 19 Apr 2005 21:13:52 -0500
> Subject: Re: [Greasemonkey] Opera 8 User JavaScript
> On 4/19/05, Edward Lee <edilee at gmail.com> wrote:
> > Should user script
> > developers try to make sure that their scripts work correctly in both
> > firefox and opera?
> 
> Should bash scripters try to make their scripts work in ksh?  Depends.
>  Lots of scripts are written for sh, but sometimes it gives up too
> much.  If XPath makes sense, I say use XPath.  Besides, porting to ksh
> shouldn't be too tough.  It's the great ideas that are harder to come
> by.  :)
> 
> >I wonder how much they actually implemented..
> > GM_functions?
> 
> > http://www.opera.com/support/tutorials/userjs/examples/#greasemonkey
> 
> I'm happy that Opera's trying for some compatibility.  But I think
> we're going to diverge come in implementation...
> 
> 
> 
> ---------- Forwarded message ----------
> From: Aaron Boodman <zboogs at gmail.com>
> To: greasemonkey at mozdev.org
> Date: Tue, 19 Apr 2005 19:42:47 -0700
> Subject: Re: [Greasemonkey] Opera 8 User JavaScript
> Amazingly cool!
> 
> On 4/19/05, Jeremy Dunck <jdunck at gmail.com> wrote:
> > On 4/19/05, Edward Lee <edilee at gmail.com> wrote:
> > > Should user script
> > > developers try to make sure that their scripts work correctly in both
> > > firefox and opera?
> >
> > Should bash scripters try to make their scripts work in ksh?  Depends.
> >  Lots of scripts are written for sh, but sometimes it gives up too
> > much.  If XPath makes sense, I say use XPath.  Besides, porting to ksh
> > shouldn't be too tough.  It's the great ideas that are harder to come
> > by.  :)
> >
> > >I wonder how much they actually implemented..
> > > GM_functions?
> >
> > > http://www.opera.com/support/tutorials/userjs/examples/#greasemonkey
> >
> > I'm happy that Opera's trying for some compatibility.  But I think
> > we're going to diverge come in implementation...
> > _______________________________________________
> > Greasemonkey mailing list
> > Greasemonkey at mozdev.org
> > http://mozdev.org/mailman/listinfo/greasemonkey
> >
> 
> 
> 
> ---------- Forwarded message ----------
> From: Mark Pilgrim <pilgrim at gmail.com>
> To: greasemonkey at mozdev.org
> Date: Tue, 19 Apr 2005 23:30:55 -0400
> Subject: Re: [Greasemonkey] (no subject)
> On 4/19/05, Geir Thorud <geir.thorud at chello.no> wrote:
> > I want to use GM to modify an image map, i.e.
> > add new areas, change the location of existing areas
> > and add JS functions to be executed when an area is
> > clicked.
> >
> > I have spent the evening trying to find out how
> > to find and manipulate the objects representing
> > the map and areas in JS.
> 
> For questions about the DOM like "how does Mozilla expose this?" I
> always go to <http://xulplanet.com/references/objref/>, which is
> auto-generated from the Mozilla source code.
> 
> For example, <http://xulplanet.com/references/objref/HTMLMapElement.html>
> has an .areas property which is a collection of
> <http://xulplanet.com/references/objref/HTMLAreaElement.html>.
> 
> Hope that's enough to get you started.
> 
> --
> Cheers,
> -Mark
> 
> 
> 
> ---------- Forwarded message ----------
> From: Mark Pilgrim <pilgrim at gmail.com>
> To: greasemonkey at mozdev.org
> Date: Tue, 19 Apr 2005 23:33:43 -0400
> Subject: Re: [Greasemonkey] Opera 8 User JavaScript
> On 4/19/05, Edward Lee <edilee at gmail.com> wrote:
> > http://www.opera.com/support/tutorials/userjs/examples/#greasemonkey
> 
> Damn it, now I have to add a whole new chapter to "Dive Into Greasemonkey".
> 
> --
> Cheers,
> -Mark
> 
> 
> 
> ---------- Forwarded message ----------
> From: Jeremy Dunck <jdunck at gmail.com>
> To: greasemonkey at mozdev.org
> Date: Tue, 19 Apr 2005 22:36:22 -0500
> Subject: Re: [Greasemonkey] (no subject)
> On 4/19/05, Mark Pilgrim <pilgrim at gmail.com> wrote:
> > For questions about the DOM like "how does Mozilla expose this?" I
> > always go to <http://xulplanet.com/references/objref/>, which is
> > auto-generated from the Mozilla source code.
> >
> > For example, <http://xulplanet.com/references/objref/HTMLMapElement.html>
> > has an .areas property which is a collection of
> > <http://xulplanet.com/references/objref/HTMLAreaElement.html>.
> 
> Also, in this case, W3 DOM level 2 HTMLMapElement:
> http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-94109203
> 
> 
> 
> ---------- Forwarded message ----------
> From: Matt Labrum <darktempler at gmail.com>
> To: greasemonkey at mozdev.org
> Date: Wed, 20 Apr 2005 14:57:48 +0930
> Subject: [Greasemonkey] Re: Greasemonkey Digest, Vol 5, Issue 79
> ---------- Forwarded message ----------
> From: Julien Couvreur <julien.couvreur at gmail.com>
> To: greasemonkey at mozdev.org
> Date: Tue, 19 Apr 2005 14:16:37 -0700
> 
> >Now that GM supports local data persistence, you can do a lot more
> >customization, while still not needing a full extension.
> >You mention the problem of local GUI. The browser is already very
> >loaded in terms of menus, configuration tabs,... Do you really need a
> >configuration menu for Google Butler when you're not visiting a Google
> >page?
> >Did you consider the solutions involving embeding your config into the
> >website? I think that approach is more user friendly and saves
> >clutter.
> 
> -------
> >3) Another option (that I like the least) would be to use a menu
> >command to start a config page (using a popup with UI embedded in the
> >user script?).
> 
> >Cheers,
> >Julien
> 
> I've been thinking about doing number 3 for quite a while , I've
> already half coded a form of it into my
> Cskinner(http://dt.x.xstreamhost.com/wordpress/cskinner/) which opens
> a option panel from either the user script commands menu or clicking
> on the normal css editor I havn't decided that bit yet.
> 
> 
> 
> ---------- Forwarded message ----------
> From: Eric Darchis <edarchis at gmail.com>
> To: greasemonkey at mozdev.org
> Date: Wed, 20 Apr 2005 12:01:42 +0200
> Subject: Re: [Greasemonkey] Choosing the right script
> On 4/20/05, Edward Lee <edilee at gmail.com> wrote:
> > On 4/19/05, Eric Darchis <edarchis at gmail.com> wrote:
> > >  However, the problem persists because the user script is not run. It only
> > > gets run on the redirected page ! 
> > 
> > That's because Greasemonkey user scripts are inserted at the end of
> > the head, and the script tags run in sequential order. The first
> > script redirecting the page will evaluate before it even gets to the
> > user script, so it seems at least for now, there won't be much that 
> > you can do to prevent the redirection.
> > 
> 
>  I just realized that the Opera user scripts CAN do that:
>  http://www.opera.com/support/tutorials/userjs/examples/#loadingscripts
>  
>  This is exactly the case of mess.be: fixing an ugly script run at page load.
>  
>  There should be a way with Greasemonkey to define a script to be run BEFORE any other on the page. For the moment, we can fix the onLoad scripts from GM but not other scripts at the same level as GM. Pretty sad.
>  
>  Eric.
>  
> _______________________________________________
> Greasemonkey mailing list
> Greasemonkey at mozdev.org
> http://mozdev.org/mailman/listinfo/greasemonkey
> 
> 
>


More information about the Greasemonkey mailing list