Closed Bug 672152 Opened 13 years ago Closed 13 years ago

context-menu not working when Gmail is opened before add-on installation, because workers aren't created for iframes that are loaded beforehand

Categories

(Add-on SDK Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: KWierso, Assigned: adw)

Details

(Whiteboard: fixed by bug 667957)

I made a test extension on Builder with SDK 1.0 to figure out something for someone on IRC tonight. ( https://builder.addons.mozilla.org/addon/1010269/latest/ )
That add-on SHOULD fire no matter what the context is, if I understand it correctly. And it does work almost everywhere. Except Gmail. If I sign in to Gmail, the context menu item does not show up.

At first I thought it was because Gmail uses iframes, but a really simple test page I wrote up (just an iframe in the page) lets the context-menu item show up.

Any ideas?
This is a test case I made that adds a context menu with builder library. And then also adds it without the library. The non-library method shows in all pages, even non-dom loaded image pages.
https://builder.addons.mozilla.org/addon/1010012/revision/28/
Oh other sites the builder library context-menu doesnt show in. Is in the js irc chat window here (i think iframe)
http://www.neocodex.us/forum/ircChat/

And in logmein after on the html frame to the left.
I can't reproduce, neither on Gmail nor on that IRC site.  The item always appears no matter where I click, as expected.

I made a new profile using Firefox 5.0.1, went to the Builder link in comment 0, clicked the Test button, logged in to Gmail, and clicked around.  Then I went to the IRC site and clicked around.

So I'm not sure what the problem is.  I wonder if it's some interaction with other installed add-ons.  Do you have any other add-ons installed that use the SDK, including simultaneously testing multiple add-ons with the Builder?  Do any of them use context-menu?  Could you try reproducing in a new profile?

(In reply to comment #1)
> even non-dom loaded image pages.

That's a different problem, bug 667957.
(In reply to comment #3)
> I can't reproduce, neither on Gmail nor on that IRC site.  The item always
> appears no matter where I click, as expected.
> 
> I made a new profile using Firefox 5.0.1, went to the Builder link in
> comment 0, clicked the Test button, logged in to Gmail, and clicked around. 
> Then I went to the IRC site and clicked around.
> 
> So I'm not sure what the problem is.  I wonder if it's some interaction with
> other installed add-ons.  Do you have any other add-ons installed that use
> the SDK, including simultaneously testing multiple add-ons with the Builder?
> Do any of them use context-menu?  Could you try reproducing in a new profile?
> 
> (In reply to comment #1)
> > even non-dom loaded image pages.
> 
> That's a different problem, bug 667957.

Hrm. It shows up fine in a somewhat-more-empty profile. Guess it's time to figure out what's stopping it in my normal profile...
Oh for the irc client page it only doesnt occur when right clicking within the client area.

But on gmail it happens everywhere. I think i figured out how to reproduce it:
I opened one tab loaded up gmail before clicking addon test. After clicking "test addon button" I opened a new tab and loaded gmail, it showed fine there, but not in the tab that was open prior to clicking test addon. (Using standard version of gmail)

When i first tried to make it show it at all times i left out the context option, what did the devs intend for a non-specified context option to do?
Ah.  Yeah, that's it.  Thanks noitidart.  Let me fix it.

(In reply to comment #5)
> When i first tried to make it show it at all times i left out the context
> option, what did the devs intend for a non-specified context option to do?

When you don't specify a context, you get the "page context".  You can read about it under the Page Context section here:

https://addons.mozilla.org/en-US/developers/docs/sdk/1.0/packages/addon-kit/docs/context-menu.html
Assignee: nobody → adw
Status: NEW → ASSIGNED
OS: Windows 7 → All
Hardware: x86 → All
I attached a new patch to bug 667957 that includes the fix to this bug.  The problem is that when a context-menu add-on is installed, workers aren't created for iframes in pages that are already loaded.  (iframes that are loaded after the add-on is installed aren't a problem.)

Thanks again guys.
Summary: context-menu not working on Gmail → context-menu not working when Gmail is opened before add-on installation, because workers aren't created for iframes that are loaded beforehand
The fix to bug 667957 landed, which also fixes this bug.  Let me know if you still see this problem in the master or SDK 1.1 when it comes out.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Whiteboard: fixed by bug 667957
Target Milestone: --- → 1.1
You need to log in before you can comment on or make changes to this bug.