objective-c - IOS webView获取js脚本文件的url
ringa_lee
ringa_lee 2017-04-18 09:45:30
0
1
611

如上图片显示,我想在webView加载这个Html文件的时候,能获取js文件的外部链接,比如:当我监控到<script src="http:///localpath/jquery-1.8.3.min.js"></script>这个地址被调用时,我替换地址调用本地脚本文件。
现在我想问:
1.这样可以实现吗?
2.我如何监控webView调用js细节,比如我再webView的代理方法里可以监控webView调用了某个URL

ringa_lee
ringa_lee

ringa_lee

reply all(1)
Peter_Zhu

1. This can be achieved
2. The specific principle is actually loading monitoring and dynamic replacement when loading a web page. There is currently a library that implements this functionality. The library is very old~ but you can use specific js cache or dynamic replacement

If you have any problems during use, you can contact me~

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!