Closed
Bug 1266001
Opened 10 years ago
Closed 8 years ago
Add-on context menus are not produced in windows created from links containing target="_blank"
Categories
(Add-on SDK Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
INCOMPLETE
People
(Reporter: netman74501+personas, Unassigned)
Details
(Keywords: testcase)
Attachments
(1 file)
|
2.17 KB,
application/x-zip-compressed
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0
Build ID: 20160407164938
Steps to reproduce:
I am developing an add-on and have noticed that windows created from links that contain "_blank" in their target attribute do not produce add-on context menus. Legacy add-ons that use XUL do not seem to be affected.
/------------------------\
| STEPS TO REPRODUCE |
\------------------------/
1. Create a new add-on and place the following in "index.js":
var cm = require("sdk/context-menu");
cm.Item({
label: "Test Item",
contentScript: 'self.on("context", function (node) {' +
' console.log(node.nodeName);' +
' return true;' +
'});'
});
2. Start Firefox with the "jpm run" command.
3. Navigate to http://www.w3schools.com/tags/att_a_target.asp and right-click in an empty space on the page to observe that "Test Item" is displayed correctly, then exit the menu. Also observe that the console logs what element you have clicked.
4. Click the big green "Try it Yourself" button on the page -- this link contains the target="_blank" attribute and should open a new window.
5. Right-click in an empty space on the newly opened window's page and observe that the "Test Item" is missing. Note that the console still logs the element you have clicked (meaning the code is actually running in the background even though the menu item is missing).
/---------------------------------\
| END OF STEPS TO REPRODUCE |
\---------------------------------/
**BONUS**
6. Close the newly opened window to reveal the original window beneath.
7. *Shift-click* the big green "Try it Yourself" button on the page.
8. Right-click in an empty space on the newly opened window's page and observe that the "Test Item" appears as it is supposed to.
**BONUS-BONUS**
9. In that same window, change the code-in-the-left-pane's target attribute to a different value such as "_top". Click the grey "See Result" button and then click the "Visit W3Schools!" link in the right pane.
10. Right-click the page that is now before you and observe that "Test Item" appears as it is supposed to -- this indicates it is only the "_blank" attribute that causes the behavior I am experiencing (I've also tried all other target values).
Actual results:
The add-on context menu does not display correctly when a window is spawned from a link with target attribute set to "_blank".
Expected results:
The add-on context menu should be displayed when a window is spawned from a link with the target attribute set to "_blank".
| Reporter | ||
Updated•10 years ago
|
Component: Untriaged → Menus
OS: Unspecified → Windows 10
Hardware: Unspecified → x86_64
Could you attach a minimal extension (.xpi) showing the issue, please?
Flags: needinfo?(netman74501+personas)
Status: UNCONFIRMED → NEW
Has STR: --- → yes
Component: Menus → General
Ever confirmed: true
Keywords: testcase
Product: Firefox → Add-on SDK
Version: 45 Branch → unspecified
| Reporter | ||
Comment 3•10 years ago
|
||
Thank you for that YF (Yang).
Loic, I started to initially include an XPI but, figured it was just as easy to simply give the code. I wasn't sure what to do as this is my first bug *ever* to report.
--
Now that one is attached, the first step in "steps to reproduce" (obviously) becomes:
Download and extract the attached "testcase.zip" then open a terminal and change directory to the "testcase" folder.
| Reporter | ||
Comment 4•10 years ago
|
||
I just noticed that this bug also happens in any window created using the Javascript open() method (ie. window.open("http://www.w3schools.com");).
You can try that out on this page if interested: http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_win_open
Comment 5•8 years ago
|
||
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•