I am building webview-based Qt app for Android, which talks to Emberjs. However, it seems that QML WebView does not support LocalStorage (but supports SessionStorage).
Are there any way to enable it? Or may you help me find a line in the documentation which states that LocalStorage is not supported in a QML WebView, since same code works for iOS?
(I know that Qt does not support WebEngineView & WebKit for mobile.)
As stated way:
A WebView renders web content within a QML application.
The WebView
is a component meant to download contents from the web and from within you cannot access objects that belong to the surrounding environment (that is, your QML application).
Anyway, you can intercept requests by means of the onNavigationRequested
signal (see here for further details), thus maybe you can imagine a webapp that tries to query a service by means of a REST API and an app that intercepts those requests and interact with the local storage.
To be honest, by looking at the documentation for Qt 4.8, the WebView
offered a way to inject objects from the QML environment, but it seems to be no longer available on Qt 5.5.
Anyway, I strongly suggest to have a look at these examples, available on the Qt website: maybe they can be helpful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With