[Greasemonkey] Greasemonkey 0.4, attempt III

Matt Labrum darktempler at gmail.com
Mon Jul 18 17:28:33 EDT 2005

ok Ive been doing some testing and I can reproduce the bug , 
1) have your menu command test script installed
2) select the tab you want the menu items to appear in
3) open gmail or something in the background (if i open links from external 
applications it will auto open them in the background)

it seems like the menu items get added to whatever tab is active at that 
time , even if that script is running on a different tab.
you may also be able to reproduce the effect by using setTimeout and 
swapping tabs but I havnt tested that yet.

On 7/18/05, greasemonkey-request at mozdev.org <greasemonkey-request at mozdev.org> 
> --------- Forwarded message ----------
> From: Aaron Boodman <zboogs at gmail.com>
> To: greasemonkey at mozdev.org
> Date: Sun, 17 Jul 2005 23:12:59 -0700
> Subject: Re: [Greasemonkey] Greasemonkey 0.4, attempt III
> Updated XPI. I think this works. Tested pretty extensively with framed
> documents.
> I also created a simple test user script for this which adds menu
> items with the URL of the document they were added from. This makes it
> easy to see when/if it's screwing up.
> ===
> But I do have a question. I noticed that Matt's script is trying to
> add menu items for frames. GM_registerMenuCommand has never supported
> this before, so he's probably hacking around it.
> In this XPI, I tried flattening all GM_registerMenuCommand calls into
> a big list in the tools menu. Would like feedback on whether this
> feels good or bad.
> My reasoning here is that not doing this makes it difficult to use
> GM_registerMenuCommand in, for instance, gmail. You'd have to include
> the user script on the top frame *and* the frame you actually want to
> modify, then expose a function in the window's scope on the top frame,
> and then call it from the bottom frame. Which is kinda dorky.
> The downside of flattening the list, like I've done here, is that
> using GM_registerMenuCommand with include * can have a strange effect
> when you're using something like gmail, which has tons of frames. In
> that case, you'd want to either make your include more specific, or
> say something like:
> if (window == top) {
> GM_registerMenuCommand( ... )
> }
> Of course, the other thing to consider is that at some point there
> will probably be a context menu with GM_registerMenuCommand items, and
> that would be the perfect place to put items from framed documents.
> But that doesn't exist yet.
> Anyway, interested in feedback on that policy point as well as general
> feedback on whether this works, as usual.
> --
> Aaron
> On 7/17/05, Matt Labrum <darktempler at gmail.com> wrote:
> > hmm it seems sometimes when adding menu items with 
> GM_registerMenuCommand
> > they persist into other tabs eg look at this screenshot
> > http://random.thedt.net/error/gm_menuitem_bug.JPG
> >
> > the script which adds those menu items adds a new menu items for urls 
> and
> > domains and frames. as you can see in that screenshot you can see the
> > frames for mail.google.com <http://mail.google.com> are showing up in a 
> different tab (there should
> > only be one skinner(url) and one skinner(domain) listed.
> >
> > yet what i find even more odd is that when i open the menu items for the
> > gmail tab theres nothing there.
> > it seems to either missplace the menu items in wrong tabs or make menu 
> items
> > persist over a few tabs.
> > gmail tab seen here
> > http://random.thedt.net/error/gm_menuitem_bug_gmailscreen.JPG
> >
> > Im using the latest trunk nightly Mozilla/5.0 (Windows; U; Windows NT 
> 5.1;
> > en-US; rv:1.8b4) Gecko/20050715 Firefox/1.0+
> > and the latest version of greasemonkey posted on this list
> > :)
> >
> > _______________________________________________
> > Greasemonkey mailing list
> > Greasemonkey at mozdev.org
> > http://mozdev.org/mailman/listinfo/greasemonkey
> >
> >
> >
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mozdev.org/pipermail/greasemonkey/attachments/20050718/bdb8e3f0/attachment.htm

More information about the Greasemonkey mailing list