I’m using window.open(url, "my_tab") to open a new tab in the browser. It works as expected in most browsers — it opens a new tab and reuses the same one if the button is clicked again. However, in Safari on mobile devices, it doesn’t automatically bring the already opened tab into focus. Is there a way to force Safari to focus the tab if it’s already open? I
const navigateToTheUrl = () => {
if (windowObjectReference === null || windowObjectReference.closed) {
windowObjectReference = window.open(testUrl.value, 'my_tab');
} else {
windowObjectReference.focus();
}
};