[webkit-qt] QtQuick WebView and QNetworkAccessManager
jocelyn.turcotte at digia.com
Thu Dec 6 03:19:23 PST 2012
On Wed, Dec 05, 2012 at 07:09:28PM +0100, Alberto Mardegan wrote:
> On 12/05/2012 02:36 PM, Jocelyn Turcotte wrote:
> >If all you want is to save cookies, there is now a default implementation for the cookie jar that automatically saves the cookies in an sqlite database in QStandardPaths::writableLocation(QStandardPaths::DataLocation).
> >The path for me on Linux is ~/.local/share/[Org]/[App]/.QtWebKit/cookies.db.
> What I need is the possibility of specifying a different cookie
> location per WebView.
> I see that WebContext has a setCookieStorageDirectory() method, but
> it's not exposed in the qt API (nor any of the other APIs, except
> the C one). Having that exposed in the QML WebView component would
> actually fulfil my needs.
> There's also a WebCookieManagerProxy class which sounds interesting,
> but I didn't understand what it is exactly.
> I wonder if there's a chance for a "cookieStorageDirectory" property
> appearing in the WebView element, or is it too late for Qt5?
This is something that makes sense to add in future versions, I think that it's too late for 5.0 though.
There would be no way to set different values on individual WebView of the same process, since there is only one WebContext instance per application.
For what kind of use do you need the cookie jars to be independent?
There is a privateBrowsingEnabled property in webView.experimental.preferences, if that can be of any help. The cookies will be enabled, but they shouldn't be saved to disk.
Just note that this is experimental API and the naming will surely change in 5.1.
More information about the webkit-qt