A QML-based web browser?



  • Personally, I think it'd be interesting to see a browser that uses QML/JavaScript instead of HTML/JavaScript. What do you think?



  • There are already a couple of projects already playing around with the idea of porting the QML language to html5/javascript.

    For instance have a look here:
    http://qt-project.org/forums/viewthread/4347



  • Thanks for the link. That's interesting, but that defeats the purpose of using QML. The purpose of using QML is for hardware accelerated performance. HTML5/JavaScript is slow compared to QML/JavaScript with GPU hardware acceleration. Consider the overhead it would take to first parse QML and convert it into an HTML equivalent using JavaScript, then the overhead of rendering the HTML with software acceleration (hardware acceleration sometimes if you're lucky). That'd be really really slow compared to real QML. QML is a markup language suited for rendering OpenGL hardware-accelerated animations and interfaces; HTML was not designed with hardware acceleration in mind like QML was.

    QML could be a serious contender to HTML! What I'm imagining is a browser that uses the Qt libraries to render QML in the same way that a QML desktop app works, but wrapped inside a browser window. QML is nice for "native" apps because it takes advantage of hardware-accelerated performance at all times. Imagine a browser that looks and feels like Chrome or Firefox, but can retrieve and execute QML with hardware acceleration using the actual Qt libraries (not a parsed HTML/JavaScript version).

    I'm imagining a browser that uses the actual Qt libraries to render QML just like what already happens when you run a hardware-accelerated QML desktop app.

    EDIT: Some browsers support hardware-accelerated animations in HTML using special CSS3 tricks, but trust me, from my short experience with QML and my extensive experience with HTML, I can tell you that QML by far surpasses HTML in the ease at which it lets you make hardware-accelerated interfaces and animations.



  • Sure, but I would not mind if QML was a web standard. After all there is really no longer a marked for another flash-style browser plugin. Performance is not the only benefit of the language. It is vastly superior to various existing html5 layout techniques for instance, so even without stellar performance I would enjoy doing web design that way.

    That said, perhaps you would be more interested this:
    in http://qt-project.org/wiki/Qt_for_Google_Native_Client

    It will of course only work in Chrome, but it gives you full Qt Quick support in a sandboxed browser environment. The latter being important since executing qml downloaded off the internet would be a major security hazard in a regular application.



  • True, QML definitely seems vastly superior for layout design and interface animation and interaction than HTML. In that aspect, I could see how a QML to HTML renderer would be nice. The fact that HTML is inferior to QML's layout techniques makes porting QML to HTML a tricky task. But definitely: it would be nice doing web design with QML.

    I would definitely not want another flash-styled browser plugin to embed in HTML pages, but it's interesting to see QML running through Google Native Client.

    In my opinion though, it seems like HTML5 is aiming to be what QML already is: an amazing and high-performing interaction/communication/animation toolset. To see QML implemented in a browser using hardware-acceleration would be amazing. Maybe the Native Client implementation can be a starting point, but I would hate to see QML embedded inside HTML pages. Ideally, I'd like to visit a URL like http://foobar.com/index.qml or http://barfoo.com (where the content's http header returned by the server specifies a QML mime-type, e.g. Content-Type: text/qml; charset=utf-8) and have the browser render the QML inside it's window without any regard to HTML whatsoever; unlike like flash, silverlight, or native client plugins that are embedded inside HTML pages.

    Maybe we do need a QML standard. Or perhaps browsers can adopt the Qt libraries (why re-invent the wheel?). Or maybe the Qt project could release it's own browser capable not just of rendering QML "pages" but also regular HTML5 pages. Or perhaps Qt can release plugins for Chrome, Firefox, and IE that give the browsers the ability to render QML "pages".



  • [quote author="Jens" date="1356623382"]
    executing qml downloaded off the internet would be a major security hazard in a regular application.[/quote]

    Why is that dangerous??


  • Moderators

    [quote author="luisvt" date="1373753461"]
    [quote author="Jens" date="1356623382"]
    executing qml downloaded off the internet would be a major security hazard in a regular application.[/quote]

    Why is that dangerous??[/quote]Without "sandboxing":http://en.wikipedia.org/wiki/Sandbox_(computer_security), scripts could access any file or hardware device on your computer. You don't want to let random online scripts access your computer -- they could be used to steal your data, destroy your files, spy on you through your webcam, etc.



  • How could we implement sandboxing?

    I know that by default QML cannot access to serial port, file system, and video cameras. To achieve that you need to import special libraries or compile them.


  • Moderators

    [quote author="luisvt" date="1373811692"]How could we implement sandboxing?[/quote]That's a big topic (sandboxing is done by web browsers, operating systems, antivirus software, and others). Google it.



  • I just went ahead and did it :)
    https://github.com/cybercatalyst/qmlbrowser


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.