admin管理员组文章数量:1406753
I'm creating an android application in which i want to use angularjs for displaying html contents in my webview.Its not working normally.I just realized that i should disable web security option since it worked in chrome when i did that.Could anyone tell me how to do that ??
I'm creating an android application in which i want to use angularjs for displaying html contents in my webview.Its not working normally.I just realized that i should disable web security option since it worked in chrome when i did that.Could anyone tell me how to do that ??
Share Improve this question asked Oct 17, 2014 at 5:38 NevaehNevaeh 1,5697 gold badges24 silver badges45 bronze badges 02 Answers
Reset to default 5webView.getSettings().setAllowFileAccess(true);
webView.getSettings().setAllowFileAccessFromFileURLs(true);
webView.getSettings().setAllowUniversalAccessFromFileURLs(true);
These lines enable cross origin requests for file:// protocol but it requires API level at least 16.
These two lines worked for me...
wv.getSettings().setAllowFileAccessFromFileURLs(true);
wv.getSettings().setAllowUniversalAccessFromFileURLs(true);
本文标签: javascriptHow to disable web security when using angularjs in android webviewStack Overflow
版权声明:本文标题:javascript - How to disable web security when using angularjs in android webview? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744816853a2626748.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论