window.opener.focus() doesn't work

1,802 views
Skip to first unread message

민병성

unread,
Sep 1, 2016, 5:51:56 AM9/1/16
to Chromium-discuss
I have a trouble in focusing a parent page from a child popup page while hiding the child popup page behind the parent page.

From the parent page,

window.open(url, 'childWnd', 'width=400,height=300,top=100,left=100')

From the child popup page,

window.blur();
window.opener.focus();

But, the expression "window.opener.focus()" doesn't work.

It works in IE.

What's wrong with it?

Am I using focus function invalidly??

PhistucK

unread,
Sep 1, 2016, 6:02:40 AM9/1/16
to bbang...@gmail.com, Chromium-discuss
Chrome does not support letting windows steal the focus programmatically.
One of the reasons is probably that it confuses users (windows suddenly jump in the middle of their work). Another one is probably that it prevents pop unders (not completely, but it is one of the basic defenses).


PhistucK

--
--
Chromium Discussion mailing list: chromium...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

---
You received this message because you are subscribed to the Google Groups "Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discuss+unsubscribe@chromium.org.

Reply all
Reply to author
Forward
0 new messages