window.opener always returns null

RESOLVED INVALID

Status

()

Firefox
Untriaged
RESOLVED INVALID
5 years ago
5 years ago

People

(Reporter: digitalcre8, Unassigned)

Tracking

23 Branch
x86_64
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(2 attachments)

371 bytes, text/html
Details
430 bytes, text/html
Details
(Reporter)

Description

5 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1612.2 Safari/537.36

Steps to reproduce:

Calling window.opener from a window that has been opened via window.open() returns null.  
- You can try opening this page:  http://www.w3schools.com/js/tryit.asp?filename=try_win_opener
- Change the line to  ***  myWindow.document.write(window.opener);  ***

You can try any other combo, like parent.window.opener, top.opener, etc and it doesn't work.  


Actual results:

The popup window says "null."  


Expected results:

It should say [object Window].
(Reporter)

Updated

5 years ago
OS: Mac OS X → Windows 7
Hardware: x86 → x86_64

Comment 1

5 years ago
Created attachment 800937 [details]
popup.html

Comment 2

5 years ago
Created attachment 800939 [details]
parent.html

Both the parent.html testcase and the example at w3schools.com works for me.

What version of firefox was this tested on?
And doesn't the testcase work for you?
Flags: needinfo?(digitalcre8)
(Reporter)

Comment 3

5 years ago
Your test files worked for me.  I think that I'm running into security issues or something because I am trying to detect whether a window is a popup (has an opener) using a FF extension.
Flags: needinfo?(digitalcre8)
(Reporter)

Comment 4

5 years ago
I'm following up on this bug. Indeed, FF extensions need to use an XPCNativeWrapper to access or detect the opener.  Otherwise, it returns null.  I got it working using this method.
(Reporter)

Updated

5 years ago
Status: UNCONFIRMED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.