Open Bug 1330153 Opened 4 years ago Updated 3 years ago

WindowObjectReference.focus() has no action


(Core :: DOM: Core & HTML, defect, P3)

50 Branch





(Reporter: bty-adminf1, Unassigned)


User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0
Build ID: 20161208153507

Steps to reproduce:

Organize web application where a domain window (tab1) opens a new one (tab2) using, getting the WindowObjectReference.
Later if the window (tab2) has to be shown, it seems coherent that :
into tab1 js instructions < the_WindowObjectReference>.focus() should be able to show the corresponding tab.

Actual results:


Expected results:

into tab1 js instructions < the_WindowObjectReference>.focus() should be able to show the corresponding tab.

I know that this is a recurrent problem since ten years linked to popup management, the same set of features used for all cases.
There are, more, the permissions problem.
In the test there are no limitations on permissions.
The problem doesn't exist with Google-chrome (but another : the tab2 can be only accessed from his "parent"...).
I am going to test : Edge, IE11, Opera

Comment about the application developed : 
a document displayed in tab1 have particularly :
  - tab2 : the bibliography references
  - tab3 : glossary
  - tab4 : index
naturally with crossed refs to anchors (hash) between each others
Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core
Is this the opposite of bug 1315950?
Flags: needinfo?(bty-adminf1)
Priority: -- → P3

Sorry, I miss, at time, to follow all the questions because I am focused on the current problem and it takes a long time to answer...

I think that it is correlated : tabs references of tabs and focus().

Behind that, I do think there are several main concepts which are intersecting at each other with parts of the code.

Historically the first development has been that a tab could open a window which was a "child". This child was strongly linked to the parent.
One example of this link is that after creating a child window with "'url','child name')", this window was not visible from another window which was nevertheless sharing the same domain.
Later and now into a same domain from another tab "'','child name')" reaches the tab (the "name-list" is managed into the domain. But the problem is that there are remaining pieces of code which restrict the views or command to parent->child and do not operate from any tab of the domain which have got the handle to the tab.

Until this will not be fully cleared (in Firefox but on most of current Browsers) there will be things like that (you set the focus but for some actions focus is not got if the tab which requires is not the parent, this for example because I have not tested).

To workaround and begin to clear the problem, check and build portable code from one to another browser, I have proposed an extension of "" with "'','name','check=true') which would answer not by an handle but by a Boolean : if window is fully held : true else false. If true the developer can manage the window from the current activated tab and for example focus the "name" without risk of dysfunction.
For now I limit the actions on focused tab from another at some verified accessible data or validated actions but generally I (my code) waits for the user "focusin" the tab focused.
Flags: needinfo?(bty-adminf1)
You need to log in before you can comment on or make changes to this bug.