I have originally asked in support-firefox mailing list, but I was
redirected here:
We are developing web application where we need to switch focus
between more windows occasionally by JavaScript.
As long as we have each page in separate browser window it works by
executing [targetWindow].focus() function. But in the case, where two
pages are just two tabs of one browser window, focus is not switched
(no error message in Error console, focus() seems to be simply
ignored). Why? Is it correct behavior? Is there other way how to
switch between tabs by JS (but content must not be reloaded!)?
Please, find simple demo at: http://tko.czweb.org/focus/
When FF option "New pages should be opened in: a new window" is set,
it works perfectly, when "New pages should be opened in: a new tab" is
set, it does not work at all.
It was tested on Firefox 2.0.0.1 and 1.5.0.9 (and IE6), Win XP Pro
SP2 machines.
Thanks in advance!
Best regards, Tomas
This is probably the wrong group too... mozilla.dev.tech.dom would be better.
> As long as we have each page in separate browser window it works by
> executing [targetWindow].focus() function.
As long as it's not disabled on the browser end, of course. Which it can be,
easily. In fact, it's disabled by default in Firefox 2. So you can't even do
that with windows, unless the user has changed the preference or you have extra
privileges.
> But in the case, where two pages are just two tabs of one browser window, focus is not switched
Sounds like bug 292314?
-Boris