Details
Description
When using runJavaScript, the iOS version cannot return an object, while Android and OSX can.
import QtQuick 2.11 import QtQuick.Window 2.11 import QtWebView 1.1 Window { visible: true width: 640 height: 480 title: qsTr("Hello World") property string html: "<html><script>var testResult={key: 'I exist!'};</script><body><canvas></canvas></body></html>"; Component.onCompleted: { webview.loadHtml(html, ''); } Timer { id: testTimer interval: 1000 repeat:false running: false onTriggered: { webview.runJavaScript("try {testResult} catch (e) {'undefined'}", function (result) { console.log('object', JSON.stringify(result)); }); webview.runJavaScript("try {JSON.stringify(testResult)} catch (e) {'undefined'}", function (result) { console.log('stringified', JSON.stringify(result)); }); } onRunningChanged: console.log('running', running); } WebView { id: webview anchors.fill: parent onLoadProgressChanged: { console.log('loadProgress', loadProgress) if (loadProgress == 100) testTimer.running = true; } } }