[Qtwebengine] Off-the-record QWebEngineProfiles
Akkana Peck
akkana at shallowsky.com
Wed May 24 03:58:45 CEST 2017
Hi! I'm using the Python bindings -- I hope that doesn't make this
off topic. I'm trying to figure out how to use a QWebEngineProfile
to do "off the record" (incognito) browsing.
The documentation for QWebEngineProfile says I can browse
off the record, without saving anything to disk, by making a
new profile with QWebEngineProfile(). But having made that
off-the-record profile, I'm not clear how to use it.
I'm trying things like this:
self.webview = QWebEngineView()
self.profile = QWebEngineProfile()
print("Profile off the record?", self.profile.isOffTheRecord())
# prints True
self.page = QWebEnginePage(self.profile)
print("Page off the record?",
self.page.profile().isOffTheRecord())
# prints False
self.webview.setPage(self.page)
self.setCentralWidget(self.webview)
Even though I pass the off-record profile when initializing the
QWebEnginePage, the page doesn't use it. Why?
Related question and maybe a workaround: where does it store profile
state? The docs I found aren't clear on that. If I knew where it was
stored, at least I could delete it on startup and exit.
Full script, if it helps to have something runnable, at
https://github.com/akkana/scripts/blob/master/quickbrowse
Thanks for any pointers!
...Akkana
More information about the QtWebEngine
mailing list