ios – Is there a way to disable cross-origin resource sharing restrictions in mobile safari

0
194


As far as I know, currently it is not possible to disable cross-origin resource sharing restrictions in mobile safari. It would be great if this could be implemented or if someone knows how to do this. This would be an incredibly useful feature for automated testing of web applications on mobile Safari.

Yes I know that we can do it with Chrome:
Disable same origin policy in Chrome

And there are options to do it with desktop Safari:
https://stackoverflow.com/questions/4556429/disabling-same-origin-policy-in-safari#:~:text=Just%20enable%20the%20developer%20menu,restrictions%22%20from%20the%20develop%20menu.
And to do it manually on Mac for mobile Safari:
https://stackoverflow.com/a/72309627/16804973

But I need to do it within Appium/Selenium code and I do not find any equivalent to Chrome option “-diasble-web-security”, because there is no such one for Safari: https://www.selenium.dev/selenium/docs/api/java/org/openqa/selenium/safari/SafariOptions.html

The last info I have found, was a request on Mac Developers page about this: https://developer.apple.com/forums/thread/80927

Does anyone has a solution for this nowadays?