[Greasemonkey] Patterns

Amit Upadhyay upadhyay at gmail.com
Wed Apr 13 14:06:37 EDT 2005


I find it useful too, was looking for something that will be executed when 
people open messages that are not open by default when you are viewing a 
thread in gmail, to be used for my smileyfy user script. But clicking on the 
headers in the conversation does not call the function that I have 
registered for click, clicking mouse on anyother place in the window calls 
the "click" callback I have registered. I tried checking out the source, but 
there is nothing I can find to lead me to the event is triggered when you 
"click" on message header. Any idea what event might be getting fired there?

TIA,

On 4/13/05, Aaron Boodman <zboogs at gmail.com> wrote:
> 
> Another pattern I like, especially for links or other clickable
> things, is listening for clicks instead of modifying the links.
> 
> It's probably snappier, and I think way easier to read.
> 
> I used it in my version of gmailto - 
> http://youngpup.net/userscripts/gmailto.user.js 
> 
> On 4/12/05, Mark Pilgrim <pilgrim at gmail.com> wrote:
> > On 4/12/05, Julien Couvreur < julien.couvreur at gmail.com> wrote:
> > > Another pattern: url re-writing.
> >
> > Right, like changing links to the printer-friendly version, or forcing
> > GMail to use https. 
> >
> > > General thought on the examples in the thread so far. A number of them 
> 
> > > illustrate how some things can be done in multiple ways. 
> > > For example, iterating over the a certain kind of element can be done
> > > with getElementsByTagName or an xpath query, or even using some more
> > > specific DOM APIs in some cases (document.links ). 
> > > As I'm getting more comfortable with XPath, I tend to use it for all 
> > > selection, where possible. Is there a reason why you think using
> > > getElementsByTagName is better? 
> >
> > It looks simpler, and therefore looks easier to debug (assuming you
> > haven't wrapped XPath into a helper function already). I have no idea
> > if one way is significantly faster than the other. Other than that, 
> > no, I have no opinion on which one is "better".
> >
> > -- 
> > Cheers,
> > -Mark
> > _______________________________________________
> > 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
> 



-- 
Amit Upadhyay
Blog: http://www.rootshell.be/~upadhyay<http://www.rootshell.be/%7Eupadhyay> 
+91-9820-859-701
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mozdev.org/pipermail/greasemonkey/attachments/20050413/5bb6adf7/attachment-0001.htm


More information about the Greasemonkey mailing list