trigger-corp/browser-extensions — pull request #31 by makern (2014-05-14 19:04:23+00:00)
Title: Force popup close when new foreground tab is opened (IE)

If a new foreground browser tab is opened from the popup window the expectation is that the popup closes so the user can interact with the opened page.

This sometimes doesn't work properly because window focus is not transferred to the new tab which means the popup doesn't lose focus and closes. I couldn't figure out why this doesn't always work but my guess is that the browser control in the popup somehow takes the focus back or otherwise manages to hold on to it.

This patch forces the popup to close when the `forge.tabs.open()` api is called with `keepFocus == false`. It's a bit of a hack but it guarantees the same behaviour as Chrome.