Coder Social home page Coder Social logo

Comments (1)

Plaristote avatar Plaristote commented on June 11, 2024

It's something I've looked into in the past, and I believe the short answer was : nope !

But there's a long answer.

There's already an implementation of WebView in qmlweb (use import QtWebView 1.0). It uses an iframe to provide a result similar to the native WebView... but some features are unavailable: history, loading html directly into the iframe, managing cookies...

These are things that we just can't do reliably with iframes, mostly because of the default CORS setup, which will prevent you from running JavaScript within an iframe... which you'd definitely need to do stuff like injecting HTML, managing the history, etc.

If you're interested in this topic, the following discussion on stackoverflow will give you all the details you need:
https://stackoverflow.com/questions/251420/invoking-javascript-code-in-an-iframe-from-the-parent-page

Basically, and if memory serves well : assuming you use the WebView to display a page that's hosted on a server that you own, then you could configure it to allow your QMLWeb application to run JavaScript inside the iframe. An implementation of WebView within QMLWeb could work on these conditions.

Here's the current implementation for WebView:
https://github.com/qmlweb/qmlweb/blob/master/src/modules/QtWebView/WebView.js

The same argument can be made for WebEngine... there's probably a whole bunch of stuff in WebEngine that just cannot be done through JavaScript code that would run from within a browser.

Anyhow, if you're interested in trying to provide a better WebView implementation, I can provide some guidance... but I'm a bit too busy at the moment to tackle this right now.

from qmlweb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.