Is it possible to propagate localization data in UIWebView (native app) and safari?

I want to create one localstorage variable from my own application using UIWebView and want to access the same version on safari.

Assuming I am setting the localstorage variable for the url: http: // localhost: 3000 / index.html from my own application and want to access the same on safari.


source to share

1 answer

This is intentionally not possible due to the built-in sandbox. One application cannot access other data including UIWebView cookies, localstorage, etc. This does not include the exchange of information between Safari and third party applications.

The closest you will most likely come to have your app launch a URL that will open in Safari and select a script from your server that will set the value you want.

Apart from the obvious disadvantage that this will be disconnected from your application and in Safari when you set the value, you also need to be very careful not to open all sorts of security holes, depending on what local storage data is being used for. ... At the very least, you would need to do a thorough health check on the stored data.



All Articles