提交 685879ab 编写于 作者: M Martin Zikmund

test: Adjust WebMessageReceived test to support Android

上级 8ce2d2a3
......@@ -59,7 +59,19 @@ public class Given_WebView2
<body>
<script type="text/javascript">
function sendMessage(){
chrome.webview.postMessage({"some": ['values',"in","json",1]});
try{
const message = {"some": ['values',"in","json",1]};
if (typeof chrome !== 'undefined' &&
chrome?.webview?.postMessage){
chrome.webview.postMessage(message);
} else if (unoWebMessageHandler){
unoWebMessageHandler?.postMessage(JSON.stringify(message));
}
}
catch (ex){
alert("wtf" + ex);
}
}
</script>
<div id='test' style='width: 100px; height: 100px; background-color: blue;' />
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册