window.open behaves differently inside the following iOS browsers:
- Mobile Safari -
window.openopens a new tab - Safari View Controller -
window.openredirects current page
- Non-standard: Safari View Controller adds a non-standard step to the WHATWG spec, by overriding the desired target browser context to "_self", rather than going through the standard sandboxing for restricting tab navigation, or simply returning null as described at the end of item 4.
- Unpredictable: Since it is nonstandard, it is impossible to know beforehand what
window.openwill do. - Flow-breaking: The aforementioned iOS browsers are indistinguishable in code, meaning existing flows using window.open must be removed when Mobile Safari is detected, even though Safari View Controller is the offender.
Google's "Chrome Custom Tabs" webview component has the same use-case as Safari View Controller for hiding the tab bar, but elegantly preserves tab flows-- by making the back button navigate the user to the previous tab (i.e. window.opener) when the current tab cannot go back any further.