devedbox / AXWebViewController

AXWebViewController is a webViewController to browse web content inside applications. It’s a lightweight controller on iOS platform based on WKWebView (UIWebView would be the base Kit under iOS 8.0). It added navigation tool bar to refresh, go back, go forward and so on. It support the navigation style on WeChat. It is a simple-using and convenient web view controller using inside applications.
MIT License
797 stars 133 forks source link

android UIWebview WKWebView JS交互的问题 #38

Open lilin87788 opened 7 years ago

lilin87788 commented 7 years ago

我现在遇到一个满纠结的问题 项目要求网页的js代码能兼容android wkweb uiweb 但是首先wkweb 和 uiweb 就好像不兼容 wkweb是window.webkit.messageHandlers..postMessage() uiweb _jsContext = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext" android 可以使用jscontext 这一套 , 请问大神我该怎么取舍了 或者目前有什么主流的解决方案

devedbox commented 7 years ago

@lilin87788 具体我也不是很清楚,但是iOS这边推荐使用wk,性能优化这些比UIWebView要好.

lilin87788 commented 7 years ago

目前后台发送的js 区分平台和版本来区分使用js代码 既然你兼容了ios7 , 作者能不能添加一个宏强制使用UIWeb,而不使用WKWeb,哪一天AX不兼容ios7了 就刚脆把UIWeb的兼容去掉,两边维护也累

devedbox commented 7 years ago

@lilin87788 目前推荐使用的是WK,UIWebView的也可以,但是UIWebView在一些比如NavigationItem的地方会出问题. 后边我会慢慢完善. 如果在使用的时候遇到什么问题可以直接issue我,或者pr我。

lilin87788 commented 7 years ago

uiwebview 没有必要取完善了 以后主线版本直接支持ios8 吧,毕竟ios11 都要出来了,个人意见

devedbox commented 7 years ago

@lilin87788 我现在主要都是放在WK的维护上了,所以后边会慢慢放弃UIWebView的.