Closed Bug 156520 Opened 23 years ago Closed 23 years ago

javascript newWindow focus fails on subsequent events

Categories

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

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: jmooney, Assigned: jst)

References

()

Details

When a newWindow is opened via a click, and a focus method is applied to the new window object, the behavior works correctly on the initial load - the newWindow takes focus. If the user goes back to the parent page, and clicks again on the windowOpen link (ending in a focus method), the window focus fails (ie, it does not come forward). Script performs multiple subsequent focus methods correctly in Internet Explorer. In Mozilla 1.0, the new window does not take focus on subsequent clicks. As sample, this URL produces the following messages in JS Debugger: http://www.landsend.com/cd/fp/prod/0,,1_2_1931_33_57364_40455_5%3Aview=-1,00.html?sid=4295034746332101730 Error loading URL <javascript:LE_popup('/swatchpopup.cgi?styleNum=76431AK4&selectedColor=DFI')>: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIChannel.asyncOpen]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://venkman/content/venkman-url-loader.js :: loadURLAsync :: line 67" data: no] function (null)() in <javascript:LE_popup('/swatchpopup.cgi?styleNum=76431AK4&selectedColor=DFI')> line 1 Error loading URL <javascript:LE_popup('/swatchpopup.cgi?styleNum=76431AK4&selectedColor=DFI')>: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIChannel.asyncOpen]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://venkman/content/venkman-url-loader.js :: loadURLAsync :: line 67" data: no] ****** Similarly constructed javascript at this URL provides a similar error display in the Mozilla JS Debugger: http://www.cnn.com/2002/US/07/09/texas.floods/index.html ( see the "Images of the flooding in Texas" Gallery popup link) Error loading URL <javascript:openWindow('/interactive/weather/0207/gallery.texas.floods/frameset.exclude.html','620x430','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=620,height=430')>: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIChannel.asyncOpen]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://venkman/content/venkman-url-loader.js :: loadURLAsync :: line 67" data: no] function (null)() in <javascript:openWindow('/interactive/weather/0207/gallery.texas.floods/frameset.exclude.html','620x430','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=620,height=430')> line 1 Error loading URL <javascript:openWindow('/interactive/weather/0207/gallery.texas.floods/frameset.exclude.html','620x430','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=620,height=430')>: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIChannel.asyncOpen]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://venkman/content/venkman-url-loader.js :: loadURLAsync :: line 67" data: no] Are these errors in JS Debugger or a broken focus method in the Mozilla JS implementation?
Reassigning to Event Handling, and cc'ing rginda to answer the Venkman question above -
Assignee: rogerl → joki
Component: JavaScript Engine → Event Handling
QA Contact: pschwartau → rakeshmishra
On second thought, this has to do with window.focus(), so reassigning to DOM Level 0. Still keeping rginda cc'ed for the Venkman question -
Assignee: joki → jst
Component: Event Handling → DOM Level 0
QA Contact: rakeshmishra → desale
Spoke to rginda, who says the errors we're seeing here in Venkman are due to a Venkman bug in handling javascript:URLs. I have filed bug 156776 against Venkman on this, and cc'ed John. Of course, there still remains the issue raised in this bug, namely, a failure of window.focus() -
So... what are the exact steps to reproduce here?
reporter (John): can you reproduce this bug with a recent build of mozilla (for example, 1.2.1)? if so, please comment again with steps to reproduce. if not, please resolve this bug as WORKSFORME. thanks.
I re-checked and the problem seems to have gone away
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.