dequan1331 / HybridPageKit

A high-performance、high-extensibility、easy integration framework for Hybrid content page. Support most content page types of News App.
MIT License
1.22k stars 184 forks source link

请问如何注入js方法到webview #39

Closed MarsLeo closed 4 years ago

MarsLeo commented 4 years ago

请问如何注入js方法到webview,在初始化HPKWebView的时候没有添加UserContentController的地方,希望能指导一下。谢谢

dequan1331 commented 4 years ago

可以创建一个自己的 WebView 继承自 HPKWebView。重写对应的initWithFrame方法。这样可以实现自定义的逻辑,同时也不会影响框架内部的逻辑。