Results 1 to 11 of 11

Thread: Did Javascript Bridge support for QWebEngine make it into 5.5?

  1. #1
    Join Date
    Nov 2008
    Posts
    183
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Did Javascript Bridge support for QWebEngine make it into 5.5?

    All,

    I cannot tell from this feature list http://wiki.qt.io/New_Features_in_Qt_5.5 if the javascript bridge feature made it into QWebEngine. Ok, technically it was called the WebKit bridge http://doc.qt.io/qt-5/qtwebkit-bridge.html but I found various posts that a WebEngine version was being worked on for 5.5. I just cannot tell from the list if it actually made it.

    Did A WebEngine bridge get built?

    thanks,

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Did Javascript Bridge support for QWebEngine make it into 5.5?

    There is a new mechanism for accessing application objects from web content: http://doc.qt.io/qt-5/qwebchannel.html

    Even works with websockets and an external browser.

    Cheers,
    _

  3. #3
    Join Date
    Nov 2008
    Posts
    183
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Did Javascript Bridge support for QWebEngine make it into 5.5?

    Anda,

    I know about WebChannel. While it could be made to work it didn't fit the bill as well as the bridge. This app has a massive common chunk of html5 and javascript which works for all platforms and the browser/kiosk type application is currently custom on each target. Right now only one target is being done with Qt and it is the last target. The others were all done with different tools. I wasn't here at the beginning to architect, so no need to point out the obvious.

    Despite the obvious, the thousands and thousands and thousands of lines of complicated back end stuff has, by my count, less than 30 lines (some of which are only comments) specific to any target. None of that target specific code attempts to load anything which would not be found natively on all targets or wasn't custom written for the package. In short, I have to hand it to the kids who did all of that without an architect because they did a mighty fine job. Asking that group bundle in qwebchannel.js which would be used on only one target and dead weight on all others is something I would like to avoid.

    No, cross compiling the Qt app for all other targets isn't a conversation which can be had. Especially since Qt doesn't have support for some of the targets, many yes, but not all.

    I thank you for your time though.

    I was just hoping they got farther than QWebChannel

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Did Javascript Bridge support for QWebEngine make it into 5.5?

    I am afraid I don't follow.

    The WebKit bridge allowed the web engine's JavaScript environment to access objects exported from the C++ part of the application.
    As does QtWebChannel.

    On top of that QtWebChannel can even be used out-of-process, e.g. using a browser as the web UI side

    Cheers,
    _

  5. #5
    Join Date
    Nov 2008
    Posts
    183
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Did Javascript Bridge support for QWebEngine make it into 5.5?

    QtWebChannel requires a wart. The index.html file _must_ load qwebchannel.js at or very near the beginning. Either we would have to have a one-off-maintenance-disaster-waiting-to-happen index.html in the build universe -- or -- the dozens of other platforms would have to have qwebchannel.js included with their package and loaded in their browser even though it does them no good and could do them harm by colliding with something else.

    The bridge did not require a big ugly wart to be included. It allowed for dynamic addition and the javascript could dynamically fall back after checking for capabilities, which it needs to do given the dozens of platforms (some of which Qt isn't even an _option_ on).

  6. #6
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Did Javascript Bridge support for QWebEngine make it into 5.5?

    Hmm, so the difference is that, behavior wise, the web engine bridge did pre-load the equivalent of qwebchannel.js?

    I am not really into the web technologies, but can't you do the same by loading an "environment page" using setHtml() which then loads the actual content?

    Cheers,
    _

  7. #7
    Join Date
    Nov 2008
    Posts
    183
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Did Javascript Bridge support for QWebEngine make it into 5.5?

    Quote Originally Posted by anda_skoa View Post
    Hmm, so the difference is that, behavior wise, the web engine bridge did pre-load the equivalent of qwebchannel.js?

    I am not really into the web technologies, but can't you do the same by loading an "environment page" using setHtml() which then loads the actual content?

    Cheers,
    _
    In theory, provided we didn't clobber anything and the index.html file didn't get horribly complex. The bridge approach was cleaner. Only two teams had to be coordinated for an injection approach. The C++ developers and the Javascript developers. Adding a file requires coordinating 4-5 teams because now source control, build, deployment, and static html groups all have to be involved. At any rate, late last night they opted to go with the webchannel route because the cheat of using the title and clipboard was going to be limiting potential enhancements down the road.

    Let the slow journey begin.

  8. #8
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Did Javascript Bridge support for QWebEngine make it into 5.5?

    Hmm, I don't see why more teams would be involved, the C++ team would be the one providing the injection.

    Not that this is relevant now, but even if QtWebEngine had the web channel built in, the other browsers wouldn't so the shared HTML/JavaScript would not be able to access any of the bridge's objects anyway, no?

    Cheers,
    _

  9. #9
    Join Date
    Nov 2008
    Posts
    183
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Did Javascript Bridge support for QWebEngine make it into 5.5?

    Quote Originally Posted by anda_skoa View Post
    Hmm, I don't see why more teams would be involved, the C++ team would be the one providing the injection.

    Not that this is relevant now, but even if QtWebEngine had the web channel built in, the other browsers wouldn't so the shared HTML/JavaScript would not be able to access any of the bridge's objects anyway, no?

    Cheers,
    _
    Ahhh, you don't work with large places that have departments in charge of things. When you add a file to a controlled project each of those departments have to be involved. The bridge allows the C++ developer to direct inject functions via existing modules. The javascript people already have mechanisms to test for functions based on platform in their existing source. Even more people have to get involved when it is a text file which could be hacked with any text editor.

    Direct injection via bridge is secure. A binary thumps it in. The only thing which can get changed by someone being evil is if the function gets called. The function already defends against garbage.

    While I would never consider Windows a secure platform, that team went the direct injection route with their toolset just to try and lock a bit more down.

  10. #10
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Did Javascript Bridge support for QWebEngine make it into 5.5?

    Quote Originally Posted by RolandHughes View Post
    The bridge allows the C++ developer to direct inject functions via existing modules.
    But that's the same thing for calling setHtml() in the webview
    This is C++, no?

    Cheers,
    _

  11. #11
    Join Date
    Nov 2008
    Posts
    183
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Did Javascript Bridge support for QWebEngine make it into 5.5?

    Quote Originally Posted by anda_skoa View Post
    But that's the same thing for calling setHtml() in the webview
    This is C++, no?

    Cheers,
    _
    Yes, it is C++. No, it is not the same.

Similar Threads

  1. QWebEngine: Ram size increases when load video
    By pipi in forum Qt Programming
    Replies: 0
    Last Post: 2nd March 2015, 10:07
  2. Replies: 7
    Last Post: 6th March 2013, 17:09
  3. Replies: 9
    Last Post: 29th November 2010, 13:12
  4. Does qmake support make install option?
    By hakermania in forum Newbie
    Replies: 14
    Last Post: 31st October 2010, 09:52
  5. How to make MDI editor with QGraphicsView support
    By Kuzemko in forum Qt Programming
    Replies: 4
    Last Post: 14th February 2007, 18:31

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.