Bug 25020 - window.focus() does not work correctly in onclick event handler when open an new page in existing window.
Summary: window.focus() does not work correctly in onclick event handler when open an ...
Status: UNCONFIRMED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-02 20:28 PDT by Barry Han
Modified: 2009-04-02 20:32 PDT (History)
0 users

See Also:


Attachments
Here's the test call html I am using. It opens another test html each time when click on the anchor in the _same_ window. But only the first time the window get focused. (209 bytes, text/html)
2009-04-02 20:31 PDT, Barry Han
no flags Details
Here's the callee (popup page) the caller called, nothing special. (44 bytes, text/html)
2009-04-02 20:32 PDT, Barry Han
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Barry Han 2009-04-02 20:28:53 PDT
Reproduce process:
Web developers usually open a page multiple times in a singleton window by assign a window name in window.open javascript call.

For example, an anchor of html page may looks like:

<a href="javascript:void(0)"
   onclick="var target=window.open('some url', 'singletonwindow', '');target.focus();return false">
text
</a>

"target.focus()" call should make the singleton window being focused whenever the anchor is clicked thus the page is refreshed, and it works in FF and IE, but does not work in safari and chrome (only the first time the window get focused).
Comment 1 Barry Han 2009-04-02 20:31:21 PDT
Created attachment 29217 [details]
Here's the test call html I am using. It opens another test html each time when click on the anchor in the _same_ window. But only the first time the window get focused.
Comment 2 Barry Han 2009-04-02 20:32:15 PDT
Created attachment 29218 [details]
Here's the callee (popup page) the caller called, nothing special.