[PyQt] save cookies and temp files to prefered folder

Peter Irbizon peterirbizon at gmail.com
Mon May 12 11:53:37 BST 2014


Hi Florian,

thank you for your kind answer! I am trying to do my tiny webbrowser with
ability to destroy all cookies (and tracking data) used by visited pages.
My idea - I click on button "Erase all" and it should erase all cookies and
tracking data so when I open page again it should be empty.

Many thanks
Peter


2014-05-11 23:16 GMT+02:00 Florian Bruhin <me at the-compiler.org>:

> Hi,
>
> * Peter Irbizon <peterirbizon at gmail.com> [2014-05-11 23:05:55 +0200]:
> > Hello, I am building simple web browser with pyqt.
>
> Cool, I'm doing the same basically! (except maybe not simple :P)
> Is your code available somewhere?
>
> > Please how can I set in my app to store all cookies and temporary
> > files to selected folder for opened website? Example is appreciated.
>
> For temporary files: It depends what you mean exactly, but for things
> like favicons/page cache/HTML5 storage/..., you simply need to do
> something like:
>
>     QWebSettings.globalSettings().setLocalStoragePath('/some/path')
>
> See:
>
> http://qt-project.org/doc/qt-4.8/qwebsettings.html#globalSettings
> http://qt-project.org/doc/qt-4.8/qwebsettings.html#setLocalStoragePath
>
>
> If you want caching of web content, it'll be a bit more complicated
> though, I think you need to subclass QNetworkAccessManager and use a
> QNetworkDiskCache.
>
>
> For Cookies, you need to subclass QNetworkCookieJar and add some way
> to save and load cookies.
>
> Example:
>
> http://git.the-compiler.org/qutebrowser/tree/qutebrowser/browser/cookies.py
>
>
> I'd really like to hear more of your project! You can reach me under
> this address via mail or Jabber, or in IRC (#pyqt on Freenode for
> example).
>
> Florian
>
> --
> () ascii ribbon campaign - stop html mail    www.asciiribbon.org
> /\ www.the-compiler.org  | I love long mails http://email.is-not-s.ms/
> Like winter snow on summer lawn, time past is time gone.
>
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20140512/047fe322/attachment.html>


More information about the PyQt mailing list