'window.focus() does not work for existing tabs in ALL IOS browsers

I'm trying to create a "re-launch" button that should bring the user to an existing opened tab. So far, this is how it's implemented:

Using window.open() initially to create the tab and focusing to that tab using window.focus().

The relaunch button should basically call window.focus() and redirect to that tab.

This has been asked in $window.focus() doesn't work on existing tabs in iOS Safari but I'd like to get a more general overview on this question. I've looked everywhere but I couldn't find any lead to this question.

Apparently, it works in android browsers but I can't get it to work in ios browsers (safari, chrome). Does anyone have any clue about this issue?



Solution 1:[1]

This seems to be a bug in iOS browsers. As a workaround you may replace focus() by a sequence of close() and open(...).

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 stewori