Uniface User Forum

 View Only
  • 1.  HTML Widget, cefbrowser, javascript & web sockets.

    PARTNER
    Posted 11-26-2019 14:31

    I am trying to populate the HTML widget with some simple code which utilises web sockets (wss:) to talk to another app on the local machine. 

    I've a simple html file which runs correctly in Chrome, connects to the app and passes me messages. 

    Within the HTML widget, the same file with the WS code in the body, Nothing seems to work. If I comment it out, then I can trigger a simple JS function to pass a message through the widget triggers. 

    I THINK I've found information on the cef browser which indicates it can't handle web-sockets, but it's dated 2015. Am I right, and I just can't do this (the other APP's API is solely web socket based)? 

    Is there something else in Uniface which can access web sockets? 

    Has anyone written a DLL or similar which would let me have this functionality? 





  • 2.  RE: HTML Widget, cefbrowser, javascript & web sockets.
    Best Answer

    ROCKETEER
    Posted 11-26-2019 14:53

    The following WebSocket echo test seems to work with the HTML widget:

    https://www.websocket.org/echo.html

    When I test this with 9.7.05 then I get the expected result.

    I hope this helps

    Kind regards,
    Daniel



  • 3.  RE: HTML Widget, cefbrowser, javascript & web sockets.

    PARTNER
    Posted 11-26-2019 15:25

    Then it must be something more esoteric in the code. 

    
    
    

    Loaded the damn page

    Click for a message


    If I comment out the code from let... to just before the end of the script, then clicking gives a message, and a button on the form can use $widgetoperation("JS:Testmessage") to send a message via the javascript.  As is, it displays the body of the page but nothing happens when I click the hyperlink and/or the button on the form. 

    I presume this means the javascript is broken, but it parses okay in chrome itself (except that window.unifacetriggers doesn't exist...)



  • 4.  RE: HTML Widget, cefbrowser, javascript & web sockets.

    PARTNER
    Posted 11-26-2019 15:27

    Forgot to mention that a load of that page into the same widget on my test form DOES show successful in 9.7.05. 



  • 5.  RE: HTML Widget, cefbrowser, javascript & web sockets.

    ROCKETEER
    Posted 11-26-2019 15:35

    Have you checked with the CEF DevTools (Ctrl+Shift+I) if there are any warnings or errors shown in the console?



  • 6.  RE: HTML Widget, cefbrowser, javascript & web sockets.

    PARTNER
    Posted 11-26-2019 15:54

    Okay, I've taken the example from that web-page and recoded the URL etc and I can now use the functionality I wanted. Not sure what the problem was with my original javascript though. 



  • 7.  RE: HTML Widget, cefbrowser, javascript & web sockets.

    Posted 11-26-2019 15:24

    Hi Iain

    What abozt libcurl:

    https://curl.haxx.se/libcurl/

    This DLL seem to have all low level "web" tools

    And if I'm right, UnifAc einternal using libcurl ...

    Ingo