Migration from Oxide
-
Hi All,
i'm moving a my old App based on Oxide library (now deprecated) to the new Ubuntu.Web
I have some issues doing that:
Using Oxide was possible send "messages" (ie: events) from QML to an html file using the function "sendMessage"
like this:In qml file:
webview.rootFrame.sendMessage("messaging://", "**GET_CONTENT**", <other param>);
In the index.html file there is the listener for the event named "GET_CONTENT":
<script> document.addEventListener("**GET_CONTENT**", function (event) { //invoke a JS function in the html file }); </script>
in qml file index.html is declare as:
WebView { url: "./www/**index.html**" })
Is possible do the same things wiht Ubunt.Web ?
Is there somewhere a guide (or better) sample code to perform the same things ?PS: the source code of the app https://github.com/fulvio999/theGrid (now on Openstore is unpublished)
Thanks !
-
@fulvio I don't know if WebChannel is available in Morph.Web, but if it is this should be the way to go, example here: https://retifrav.github.io/blog/2018/07/14/html-from-qml-over-webchannel-websockets/
-
-
@fulvio
WebEngineView
is used inMorph.Web
module so anything that that supports should just work. -
@fulvio Humm at least websocket should be working as https://www.websocket.org/echo.html works.
Don't know for the WebChannel, could you provide some logs ?,