Accessing UIWebView local storage data from native iPhone app

自古美人都是妖i 提交于 2019-12-03 13:01:43

I was looking to do something similar to this. In short, the DOM and all elements are not directly accessible. However, you can hack things up to get at the data. What you have to do is inject your own javascript into the downloaded webpage. Then evaluate the results.

This page shows the mechanism for doing it:

http://iphoneincubator.com/blog/windows-views/how-to-inject-javascript-functions-into-a-uiwebview

Then you just need to know the name of the database and create some javascript to return the values in a JSON string. Use a cocoa JSON parser to create objects from that string that you can use in your native app.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!