From 6e66dca749831fdf8497442208cdcc6ff9518cf3 Mon Sep 17 00:00:00 2001 From: keis Date: Fri, 3 Dec 2010 02:01:52 +0100 Subject: bring it all together add script that loads all cookies from a file by calling add_cookie disable cookie_handler in config call load_cookies.sh from config don't start cookie daemon in uzbl-browser --- examples/data/scripts/load_cookies.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 examples/data/scripts/load_cookies.sh (limited to 'examples/data/scripts/load_cookies.sh') diff --git a/examples/data/scripts/load_cookies.sh b/examples/data/scripts/load_cookies.sh new file mode 100755 index 0000000..a192d3b --- /dev/null +++ b/examples/data/scripts/load_cookies.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +if [ "$1" != "" ]; then + cookie_file=$1 +else + cookie_file=${XDG_DATA_HOME:-$HOME/.local/share}/uzbl/cookies.txt +fi + +echo $cookie_file + +awk -F \\t ' +BEGIN { + scheme["TRUE"] = "https"; + scheme["FALSE"] = "http"; +} +$0 ~ /^#HttpOnly_/ { +printf("add_cookie \"%s\" \"%s\" \"%s\" \"%s\" \"%s\" \"%s\"\n", substr($1,length("#HttpOnly_"),length($1)), $3, $6, $7, scheme[$4], $5) +} +$0 !~ /^#/ { +printf("add_cookie \"%s\" \"%s\" \"%s\" \"%s\" \"%s\" \"%s\"\n", $1, $3, $6, $7, scheme[$4], $5) +} +' $cookie_file > $UZBL_FIFO -- cgit v1.2.3