Closed
Bug 381620
Opened 18 years ago
Closed 18 years ago
window.focus() does not bring opened windows to front
Categories
(Firefox :: General, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: ilanio, Unassigned)
Details
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-BR; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-BR; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3
As Firefox doesn't have showModalDialog function, a way to create an equivalent function is using the focus() method to return focus to popup window when it looses it.
The method focus(), actually, is not working (version 2). When I uninstall version 2 and install version 1.5, the method works perfectly.
Returning to version 2, the method stops working again.
Reproducible: Always
Steps to Reproduce:
Save the code below to a file (temp.htm)
---------------------------
<html>
<head>
</head>
<script language="JavaScript">
var Wnd;
function OpenWnd() {
Wnd = window.open("about:blank","Janela","Height=300px,Width=400px,center=yes,help=no,status=no");
Wnd.focus();
}
function GoFocus() {
if (Wnd) {
if (!Wnd.closed) {
Wnd.focus();
}
}
}
</script>
<body onFocus="GoFocus()">
<input type="button" value="Open Window" onClick="OpenWnd()">
</body>
</html>
---------------------------
Open the file in FF 2. Clicking the button, a new popup window is opened. When I click on the parent window, the popup disapears (goes to background).
On FF 1.5 the popup window remains on top (as desired when using focus() method).
Actual Results:
In FF 2, after the popup is opened, clicking on the parent window, the popup disapears (goes to background)
Expected Results:
If the focus() method works correctly, the popup window remains over the parent window and doesn't go to background.
Comment 1•18 years ago
|
||
It works when you first check the box "Allow scripts to raise or lower windows" in Tools -> Options -> Content -> Enable JavaScript - Advanced.
Status: UNCONFIRMED → RESOLVED
Closed: 18 years ago
Resolution: --- → INVALID
| Reporter | ||
Comment 2•18 years ago
|
||
Ok, checking this option the function starts to work.
There's a way to programmatically enable this option, or I always need to instruct the user?
Please, note that FF is becoming a browser for "advanced users" since the common user does not change the browser options that came by default.
If the functionalities are disabled by default, most of users lost them.
The FF developers are working by exceptions: first the "modal=yes" was disabled to be executed by common scripts and now we need to pay for a digital signature to work with it on our scripts. Now the focus function came disabled by default.
In near future some users will not use FF because they will believe that browser doesn't have functionalities that it will have, but are disabled by default.
A lot of users come to me asking to return to IE on my comapany machines, because the FF was not working with focus() and I really to confess I didn't know about this new "default configuration".
Result: Now I need to enable this functionality on every machine, because user doen't know how to make it.
Comment 3•18 years ago
|
||
The script capability to raise windows or make them modal is disabled for a
good reason: it can be used maliciously by sites such as Last Measure.
Have you tried using DHTML to make a box within the page and putting your
dialog content into that box?
You need to log in
before you can comment on or make changes to this bug.
Description
•