UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Migration from Oxide

    Scheduled Pinned Locked Moved App Development
    9 Posts 3 Posters 1.8k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
      Reply
      • Reply as topic
      Log in to reply
      This topic has been deleted. Only users with topic management privileges can see it.
      • F Offline
        fulvio
        last edited by

        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 !

        lduboeufL 1 Reply Last reply Reply Quote 0
        • lduboeufL Offline
          lduboeuf @fulvio
          last edited by

          @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/

          F 1 Reply Last reply Reply Quote 0
          • F Offline
            fulvio @lduboeuf
            last edited by fulvio

            Thanks @lduboeuf for the interesting links, is the right direction, but after some attempts
            seems that WebChannel is not included/supported in Morph.Web. Also QtWebSockets doesn't works.

            K lduboeufL 2 Replies Last reply Reply Quote 0
            • K Offline
              kugiigi @fulvio
              last edited by

              @fulvio WebEngineView is used in Morph.Web module so anything that that supports should just work.

              1 Reply Last reply Reply Quote 0
              • lduboeufL Offline
                lduboeuf @fulvio
                last edited by

                @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 ?,

                F 1 Reply Last reply Reply Quote 0
                • F Offline
                  fulvio @lduboeuf
                  last edited by fulvio

                  Thanks @lduboeuf for the links (sorry for the late response but i was busy).
                  They are the right direction to solve the issues (QML <--> html communication without Oxide).

                  I'm trying to implements the solution "Mostly qml" described at: https://retifrav.github.io/blog/2018/07/14/html-from-qml-over-webchannel-websockets/
                  because implements both the side (html and qml)

                  I have create a new C++ App using clickable and looked at sample code from article source: https://github.com/retifrav/qml-webchannel-websockets/tree/master/websockets-mostly-qml)

                  But there is an issues running "clickable desktop" :
                  "webSocketTransport.h:11:40: fatal error: QWebChannelAbstractTransport: No such file or directory"

                  (QWebChannelAbstractTransport is a standard QT class)
                  I'm not a QT/C++ developer but i suppose that some QT components are not included in Clickable to implements the solution.

                  Thanks

                  lduboeufL 1 Reply Last reply Reply Quote 0
                  • lduboeufL Offline
                    lduboeuf @fulvio
                    last edited by

                    @fulvio this issue could be a good candidate for a bug report https://github.com/ubports/morph-browser/issues

                    I've tried also without success too but can't remember the issue.

                    F 1 Reply Last reply Reply Quote 0
                    • F Offline
                      fulvio @lduboeuf
                      last edited by fulvio

                      @lduboeuf Done: https://github.com/ubports/morph-browser/issues/454

                      F 1 Reply Last reply Reply Quote 1
                      • F Offline
                        fulvio @fulvio
                        last edited by

                        UPDATE: After some attempts and the help of Balcy user i finally get a working example on Desktop: clickable desktop
                        Source code: https://github.com/fulvio999/testWebChannel

                        Running on device i have this blocking issue: https://github.com/fulvio999/testWebChannel/issues/1
                        Any idea to solve it is welcome. Thanks !

                        1 Reply Last reply Reply Quote 2

                        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                        With your input, this post could be even better 💗

                        Register Login
                        • First post
                          Last post