User Tools

Site Tools


cleancookies

Introduction

Large cookies file slows down uzbl. If it takes long time to load webpages, and you CPU is consumed by uzbl-cookie-daemon, it's time to clean your cookies file.

cleancookies script reads cookies.txt (from stdin or from file, see -c option) and prints on stdout cleaned file. It removes all expired cookies. It may also work in “whitelist” or “blacklist” mode. To enable “whitelist” mode, pass -w FILE option. To enable “blacklist” mode, pass -b FILE option. In whitelist mode it removes all cookies except whitelisted, in blacklist mode it removes blacklisted cookies.

FILE contains list of regular expressions separated with new lines. Each cookies domain is mathed against each line of this file. Example (white/black)list file:

.*\.uzbl\.org
github
google\.(com|pl)

You can execute this file once, add it to crontab or ~/.xsession.

cleancookies script is available in following git repo: http://github.com/pawelz/uzbl-maintanance

./cleancookies -h

cleancookies [-w FILE | -b FILE] [-c COOKIES]

       -w FILE    - read whitelisted domains from FILE
       -b FILE    - read blacklisted domains from FILE
       -c COOKIES - read cookies from COOKIES file instead of stdin
       -h         - print this help
       -V         - print version

If -w or -b option is specified, cleancookies treats each line of FILE as regular expression that cookie domain is matched against.

COOKIES file (or stabndard input) should be cookies.txt file as used by mozilla and uzbl-cookie-daemon.

EXAMPLE: add following script to your .xsessionrc, or register it in crontab:

tmp=$(mktemp)
wl=${XDG_CONFIG_HOME:-$HOME/.config}/uzbl/whitelist
ck=${XDG_DATA_HOME:-$HOME/.config}/uzbl/cookies.txt
cleancookies -w $wl -c $ck > $tmp
mv $tmp $ck
killall uzbl-cookie-daemon && uzbl-cookie-daemon -v start
cleancookies.txt · Last modified: 2016/08/31 14:10 (external edit)