[Interest] How to reset QML WebView?
Olivier Tilloy
olivier.tilloy at canonical.com
Thu Jun 5 20:59:14 CEST 2014
On Tue, Jun 3, 2014 at 6:28 PM, Николай Шатохин <n.shatokhin at gmail.com>
wrote:
> import QtQuick 2.0
> import QtWebKit 3.0
> import QtWebKit.experimental 1.0
>
> Item {
> width: 640
> height: 480
>
> signal closeWindow();
>
> WebView
> {
> anchors.fill: parent
> url: address
> experimental.preferences.privateBrowsingEnabled: true
> }
> }
>
>
> 2014-06-03 19:27 GMT+03:00 Николай Шатохин <n.shatokhin at gmail.com>:
>
> I just tried it. Not working.
>>
>
Indeed, I tested the example you linked, adding
"experimental.preferences.privateBrowsingEnabled: true" to the webview, and
it doesn’t work.
Even deleting $HOME/.local/share/webview_test/.QtWebKit (which is where the
cookies are persistently stored) in between doesn’t help.
It’s as if the cookie database was kept around in memory, despite the
webview being destroyed (and the privateBrowsingEnabled preference is not
being respected).
Those look like bugs in QtWebKit which should be reported upstream.
Note that if your app is targetting Ubuntu specifically, you might want to
give a go at the UbuntuWebView API instead:
import QtQuick 2.0
import Ubuntu.Components.Extras.Browser 0.2
UbuntuWebView {
incognito: true
}
I just tested it here, and it works as expected (i.e. the second time
around the user is not logged in).
HTH,
Olivier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140605/548207c6/attachment.html>
More information about the Interest
mailing list