Open
Bug 1300555
Opened 9 years ago
Updated 2 years ago
When using window.opener to alert() in a different window, the window with the alert should be focused
Categories
(Firefox :: Tabbed Browser, defect)
Tracking
()
NEW
People
(Reporter: maksouw85, Unassigned)
Details
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:48.0) Gecko/20100101 Firefox/48.0
Build ID: 20160728203720
Steps to reproduce:
I'm opening a popup. When I finish my process in the popup, it sends a message to the main window in an alert.
In FIREFOX ESR 38.8.0
- Open a window with window.open
- Use window.opener.myFunc(myMsg) to send message
- window.opener.myFunc(myMsg) alerts myMsg
Actual results:
The popup keeps the focus, the alert message is displaying on main window.
Expected results:
The main window gets the focus and alerts the message.
| Reporter | ||
Updated•9 years ago
|
Component: Untriaged → General
OS: Unspecified → Windows 7
Comment 1•9 years ago
|
||
Some questions:
- can you link to a (ideally minimal) testcase somewhere on the web that we can use to test, so that we're sure we're talking about the same thing?
- what versions of Firefox does this behaviour work correctly in, and in which versions is it broken?
- is the behaviour you're describing broken or working in 38 ESR? Or do you really mean 45 ESR, or 48, when describing where it's broken, and saying it works in 38? (it sounds like the result of bug 332195 which was fixed for 44, so if you're on ESR you would have seen a change in 45 but not in 38).
Component: General → Untriaged
Flags: needinfo?(maksouw85)
Summary: Setting focus on main window after sending data by window.opener.myFunc() → When using window.opener to alert() in a different window, the window with the alert should be focused
| Reporter | ||
Comment 2•9 years ago
|
||
Sorry, I tried to make a jsfiddle but, because I use a window.open, I can't make it work like in my code. Here's a simple fiddle, you can see how it's being used : https://jsfiddle.net/kmptfsor/4/
This behaviour is broken in Firefox ESR whatever version. It works in Firefox standard version.
The fact is, in Firefox, when you're sending an alert, the window which show this alert get the focus is going on top screen automatically. It doesn't with Firefox ESR 38/45/...
Tested right now on FF ESR 45 : no change.
Comment 3•9 years ago
|
||
Firefox: 48.0.2, Build ID 20160823121617
User Agent Mozilla/5.0 (X11; Linux x86_64; rv:48.0) Gecko/20100101 Firefox/48.0
Hi Maxime,
I have tested this issue on the latest Firefox ESR (43.3.0 Build ID: 20160725105554), latest Firefox (48.0.2) release and latest Nightly (51.0a1) build using the test case provided in comment 2. I have opened the provided test case, then I click the "click me" button. A new window was opened and I clicked the "send to opener" but nothing happened. I have returned to the previously tab and clicked the "myFunc" button and a "I opened the window" alert was opened on the same tab. I got the same behavior on all Firefox versions that I have tested.
Maxime, is this the right test case for the described issue? Can you provide some steps to reproduce this issue with the provided test case?
Also, can you please test this issue using a new clean Firefox profile, maybe even safe mode, to eliminate custom settings as a possible cause (https://goo.gl/PNe90E) and report back the results?.
Hi,
I've already tested on a clean Firefox ESR (fresh install :) ) and nothing changed. My fiddle isn't working at all, but I don't know if I can do anything very similar to my problem...
When you click on the "Click me" button, it sends you to another tab / window. When you click, on this new window, on the "Send to opener", in my case (in my code, not the fiddle), it open a "confirm" popup on the window with "click me" button, but this window don't get the focus.
Ok guys, I've made a test that's working. You have to get the first Jsfiddle content (https://jsfiddle.net/kmptfsor/5/) and put it into a file called "index.html".
You take the second fiddle (https://jsfiddle.net/Lxeq95jv/) and you put it into a file called "popup.html".
Open index.html with your Firefox (here, Firefox ESR 38.8, and tested on Firefox 48 too), and click the "click me" button. It'll open a popup with a "send to opener" button. Click this button. You'll see an alert on the first window, and the focus is not taken by this window.
Comment 6•9 years ago
|
||
Firefox: 48.0.2, Build ID 20160823121617
User Agent Mozilla/5.0 (X11; Linux x86_64; rv:48.0) Gecko/20100101 Firefox/48.0
I was able to reproduce the described issue on the latest Firefox (48.0.2) release, Firefox 38.0 ESR and latest Nightly (51.0a1) build. For testing this I have used the provided test cases in comment 5. I have opened the created "index.html" and clicked the "Click me" button. A new window was opened and I have pressed the "send to opener" button. Then "I opened the window" alert is displayed on the "index.html" page, but the focus remains on the new opened window.
Also, I was able to reproduce this issue on Windows 7 x64.
Status: UNCONFIRMED → NEW
Component: Untriaged → Tabbed Browser
Ever confirmed: true
Flags: needinfo?(maksouw85)
Comment 7•9 years ago
|
||
(In reply to Maxime Charron from comment #2)
> Sorry, I tried to make a jsfiddle but, because I use a window.open, I can't
> make it work like in my code. Here's a simple fiddle, you can see how it's
> being used : https://jsfiddle.net/kmptfsor/4/
>
> This behaviour is broken in Firefox ESR whatever version. It works in
> Firefox standard version.
This is confusing. Which "standard" version of Firefox does it work on? Comment #6 suggests it also doesn't work on recent versions of regular Firefox.
Unless we've regressed something here, I'd actually be tempted to wontfix, because not focusing the tab is what we do for the intra-window thing, so not focusing the window would be the consistent thing to do for the inter-window thing.
Flags: needinfo?(maksouw85)
| Reporter | ||
Comment 8•9 years ago
|
||
I'm sure it worked on an older standard version of Firefox, but I can't find which was this version...
Tested via Browserstack on FF 38, 43, 44 and never worked on these version. So if you say it's the normal behaviour, wontfix then.
Why did you choose to not focusing the tab in intra-window ?
Updated•3 years ago
|
Severity: normal → S3
Comment 9•2 years ago
|
||
Clear a needinfo that is pending on an inactive user.
Inactive users most likely will not respond; if the missing information is essential and cannot be collected another way, the bug maybe should be closed as INCOMPLETE.
For more information, please visit BugBot documentation.
Flags: needinfo?(maksouw85)
You need to log in
before you can comment on or make changes to this bug.
Description
•