'Safari in fullscreen mode ahref target "_blank" does not open in new window

We have an app that opens in a new window (popup) with defined window size. There are links in the app that open another external links.

We have a code to handle ahref links to open in a new window using target as "_blank".

It works fine with all the browsers except in Safari when the popup window is changed to fullscreen mode. Once in fullscreen mode the external links (even with _blank) open in the same window and replace the content of the main window.

I want to open the external links in a new tab/window always.

Please help.

handleLinks: function (link) {
    var url = link.href;

    if (url && !url.indexOf('http')) {
       link.target = '_blank'
       link.rel = 'external';
    } else if (url && !url.indexOf('mailto')) {
        // FIX FOR CHROME BROWSER NOT TO OPEN IN A BROWSER TAB FOR MAIL CLIENT
       link.target = '_top';
    }
}


Sources

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

Source: Stack Overflow

Solution Source