Context menu items not present if tab has been detached.



Add-on SDK
7 years ago
7 years ago


(Reporter: KWierso, Assigned: adw)



Firefox Tracking Flags

(Not tracked)





7 years ago
Someone in the newsgroup (see URL) posted that if they detach a tab from a window, the SDK-added context menu items are no longer present in that tab.

I'd guess that means that the page's onload event isn't being fired again for the detachment process, so the items are never added to the menu.

Is there some other events that context menu should be listening for?
Hmm, I can't reproduce, neither with the "a simple add-on" translator example nor with this simple add-on:

  var cm = require("context-menu");
    context: cm.SelectionContext(),
    label: "* selection"

Wes, can you reproduce?

Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:6.0a1) Gecko/20110422 Firefox/6.0a1

Comment 2

7 years ago
(In reply to comment #1)
> Wes, can you reproduce?

I think I can, here on Win7. Here's my steps:
Install this addon: (it's what you posted in comment 1, Drew)
Select some text on the page. 
Context-click on the selection, and you'll see the extra menu item.
With the selection still selected on the page, detach the tab. (The selection should be carried over to the detached tab, or at least it does for me.)
Context-click on the selection in the detached tab, and there isn't the extra menu item included. (I also try making a different selection, and it doesn't show the menu item...)
Reload the page, make another selection and context-click the selection, and you should see the extra menu item again.

Build identifier: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0a1) Gecko/20110425 Firefox/6.0a1
Thanks Wes.  I can reproduce if I install an XPI but not if I cfx run.  Also, if you install an XPI, items don't appear for tabs that were opened before installation.  I think something's wrong with the context detection, maybe because content workers aren't properly created for tabs that were opened before installation.  I'll take a look.
Assignee: nobody → adw
OS: Windows 7 → All
Hardware: x86 → All
Wes, could you try reproducing with the current master on GitHub?  I tested this some more: I can reproduce with Add-on SDK 1.0b4, but I can't reproduce with the current master.

However, the current master has a related bug where pages that are opened before XPI installation don't get context menu items.

I think both situations are due to bug 648434, which landed after 1.0b4.

Comment 5

7 years ago
I'll check that tonight when I have access to something other than just Builder, but that sounds like that'd do it.
Thanks Wes.

(In reply to comment #4)
> However, the current master has a related bug where pages that are opened
> before XPI installation don't get context menu items.

bug 652978
Wes, did you get a chance to try to reproduce this using 1.0b5?
Perhaps P2 if we can reproduce and it seems bad.
Priority: -- → P3
Target Milestone: --- → 1.0

Comment 9

7 years ago
I can no longer reproduce using something newer than 1.0b4.
OK, thanks Wes.  I'm marking WFM.  I'll post to the user group thread and ask Greg to follow-up if the problem is still present in 1.0b5.
Last Resolved: 7 years ago
Resolution: --- → WORKSFORME
Greg emailed me privately and said that he tried with ZIP of the master branch generated by GitHub and that the problem is no longer present.
You need to log in before you can comment on or make changes to this bug.