Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

建议 #3

Closed
brucewuu520 opened this issue Nov 10, 2014 · 1 comment
Closed

建议 #3

brucewuu520 opened this issue Nov 10, 2014 · 1 comment

Comments

@brucewuu520
Copy link

在很多时候用webview打开别人的网页需要向网页中注入js代码,以检测某些操作,可不可以把这部分功能也加入进去呢?
还有个疑问,HostJsScope类中方法的多少会不会影响效率或是页面打开的速度呢?

@pedant
Copy link
Owner

pedant commented Nov 10, 2014

向别人的网页注入java类的方法一样,不同的是js回调java里需要显式的loadUrl执行js,详细可以参看 http://www.pedant.cn/2014/07/04/webview-js-java-interface-research/ 这篇文章下的评论,当然还有框架优化的空间,会考虑。另外像HostJsScope这样的注入类方法的多少不会影响页面打开的效率,方法的扫描只在InjectedChromeClient实例化时执行一次,后面都直接将拼接好的js片段(相当于静态)注入。

@pedant pedant closed this as completed Nov 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants