问题
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