开发者

Android WebView Java-Javascript bridge

开发者 https://www.devze.com 2023-04-10 00:28 出处:网络
I wonder if it\'s possible to obtain Javascript variable value from Java code. In other words, I\'ve got JS code in WebV开发者_如何学JAVAiew and I need to be able to obtain variables from that JS code

I wonder if it's possible to obtain Javascript variable value from Java code. In other words, I've got JS code in WebV开发者_如何学JAVAiew and I need to be able to obtain variables from that JS code from WebView.


Yes it's possible by installing Java-JS bridge and then injecting JS into page that collects the data and returns it via JS bridge. See this answer: How to call javascript from Android?

0

精彩评论

暂无评论...
验证码 换一张
取 消