We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
为了实现webView和navtive埋点数据的同步,我们把page数据放到了cookie中给前端去读取。 前端读取cookie的时候(html、样式、脚本等静态资源加载完成,脚本文件开始解析执行),发现 window.prompt("KKJSBridge", messageString) 返回的response为null。打断点后发现prompt并没有触发UIDelegate的代理方法。
KKJSBridge.prototype.syncCall = function (module, method, data) { function call() { var message = xxx var messageString = JSON.stringify(message); var response = window.prompt("KKJSBridge", messageString); return response ? JSON.parse(response) : null; } xxx };
The text was updated successfully, but these errors were encountered:
弱弱地问一句,你是想走同步 JS 交互接口,还是想弹个框?
Sorry, something went wrong.
就是想获取cookie信息,用的 'KKJSBridge/AjaxProtocolHook'
需要在自己自定义的 webview 代理里实现如下代码
已经实现了上面的代码,并且【不触发UIDelegate回调方法】的情形只在打开第一个webView的情况下才会出现,打开第二个webView就能正常走UIDelegate回调逻辑。
因为读取行为也是通过脚本自动执行的,推测可能跟js注入有关。目前临时方案是取消webView的预热,可以解决问题。但后面不知道该如何进一步分析,找出原因
No branches or pull requests
为了实现webView和navtive埋点数据的同步,我们把page数据放到了cookie中给前端去读取。 前端读取cookie的时候(html、样式、脚本等静态资源加载完成,脚本文件开始解析执行),发现 window.prompt("KKJSBridge", messageString) 返回的response为null。打断点后发现prompt并没有触发UIDelegate的代理方法。
The text was updated successfully, but these errors were encountered: