Focus sibling window in Chrome

为君一笑 提交于 2021-02-08 09:32:49

问题


I've got an application which has several child windows. For user experience reasons, sometimes we want to re-use these windows instead of always opening new ones. So the main window has two child windows, A and B. The user is using Child A. As a result of their action in Child A, we wish to focus Child B and perform an action on it.

I have complete control of the source for all windows involved.

Unfortunately, it seems like Child A no longer has the right to focus Child B in Chrome. The main window can give it focus, but only if it has focus, and the user is using Child A. Therefore there seems to be no way for Child A to grant Child B focus unless we somehow roundtrip focus through the parent window, messing up the window order, e.g. Child A would then be last in the order instead of underneath Child B.

I have tried to fix this by simply having all three windows involved attempt to focus Child B, but none of them can.

Any suggestions?

来源:https://stackoverflow.com/questions/63156233/focus-sibling-window-in-chrome

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!