0

I have tried below approaches, but in both situations, iOS Safari will treat my new tab as a popup (I always see a popup warning message)

Approach 1.

window.open(url, "_blank");

Approach 2.

let a = document.createElement("a");
a.href = url;
a.target = "_blank";
a.click();

Expected behavior:

New Safari tab opens seamlessly without user explicitly 'allow' the popup

Actual behavior:

User needs to click 'Allow' before new tab opens

Is there a way to programmatically achieve expected behavior?

xzk
  • 827
  • 2
  • 18
  • 43

2 Answers2

0

you cant force a new tab, its based on browser settings (regarding to browsers on desktop)

and you can't simulate a browser click to make the browser think the user clicked on it to open the new window...

the popupblocker will always intercept if the user didnt click anything XYZms before, for security reasons

Kapsonfire
  • 1,013
  • 5
  • 17
0

There is no solution to fix this so far.

Please refer below links,

Appium iOS Safari Open new tab, accept alerts and switch between two tabs

https://github.com/appium/appium/issues/6864

https://support.apple.com/en-us/ht203987

Rajkumar A
  • 87
  • 5