Embedding Javascript in an SFSafariViewController

I am not sure if this is possible. I am currently developing an application for storing store passwords (for example, for a password manager). One of its functions is to allow the user to automatically log into the web browser of this device. I was able to get it to work using UIWebView and WKWebView, but I can't find a way to get it to work using SFSafariViewController. I read several documents and blogs about this and even read the SFSafariViewController.h file, but there is no hint there that can lead me to the function that I wanted. I want to know how to execute the "evaluate JavaScript" -a-like function in the SFSafariViewController, or if this is not possible, do you have any other suggestions on how to achieve this?

Note. I am using Objective-C.

Thanks in advance! Happy coding!

+4
source share
1 answer

SFSafariViewControllersisolated. Because they are essentially Safari and have access to cookies. This will be a security risk allowing any application to access them.

However, if the web service that you want the user to be able to sign in is yours, you can configure the API and custom URL scheme.

Follow this documentation .

If you are trying to save passwords, etc. from sites that you donโ€™t support, then, unfortunately, this is not possible with SFSafariViewController.

Hope this helps,

Liam

0
source

Source: https://habr.com/ru/post/1626055/


All Articles