Open zcl0001 opened 5 years ago
DOWNGRADE_JS_INTERFACE 为false时候 ,android 貌似调用的是web,应该是prompt('" + BRIDGE_NAME + "://postMessage?message=' + JSON.stringify(message) + '&targetOrigin=' + targetOrigin),这样webviewClient 才能拦击,分发消息
向下面这样写,Android端才能收到消息,还有web组件的文档有错误,而且没有说明message事件,多少人都卡在画图上和web组建的消息实现上啊
`<!DOCTYPE html>
`
http://dotwe.org/vue/dcd80a4ce141d639e4b08de86f0bfc27 给个dotwe 例子可以复现的例子
辛苦提一个PR,修复文档和DOWNGRADE_JS_INTERFACE
的问题,我会来Review
com.taobao.weex.ui.view.WXWebView 247行到254行,DOWNGRADE_JS_INTERFACE 逻辑貌似写反了
if (mOnMessageListener != null) { evaluateJS("javascript:(window.postMessage = function(message, targetOrigin) {"