* backspace key to pop characters from (multichar) command
* optional logging of http requests&responses with ip/hostname and port. -> how to implement? handler? stdout? (through a socket so you know what corresponds to what?)
* bench/optimize fifo vs socket performance. measure delays. minimize forks. does glib use a shell? how does it detect the shebang line?
-* cookie support.
+* cookie support. storing seems to work, but not yet sending
* "remember account settings" support. but how? configure post data per site? regex match eg '^bbs.archlinux.org' ?
* http_proxy env var not recognized. libproxy (used by libsoup) should handle this http://mail.gnome.org/archives/libsoup-list/2009-February/msg00018.html
* support ssl. do ssl certificate & exception management similar to how we do cookies
* improve DCOMMIT macro. what if WC is dirty? what if user downloaded tarball without .git?
* DARCH is not correct (should be at runtime)
-
+* when loading page foo.com, it can have img src=http://bar/..., uri in uzbl will be set to foo. we must pass bar to cookie handler
* variable replacing:
user agent -> str_replace(all vars) DONE
title bar -> str_replace(all vars)
# MAYBE TODO: allow user to edit cookie before saving. this cannot be done with zenity :(
# TODO: different cookie paths per config (eg per group of uzbl instances)
+# TODO: correct implementation.
+# see http://curl.haxx.se/rfc/cookie_spec.html
+# http://en.wikipedia.org/wiki/HTTP_cookie
+
+# TODO : check expires= before sending.
+# write sample script that cleans up cookies dir based on expires attribute.
+# TODO: check uri against domain attribute. and path also.
+# implement secure attribute.
+
+
if [ -f /usr/share/uzbl/examples/configs/cookies ]
then
file=/usr/share/uzbl/examples/configs/cookies
which zenity &>/dev/null || exit 2
uri=$6
+uri=${uri/http:\/\/} # strip 'http://' part
action=$8 # GET/PUT
+cookie=$9
host=${uri/\/*/}
sed -n "/$1/,/^\$/p" $file 2>/dev/null | grep -q "^$host"
}
-function readcookie () {
- cookie=
- while read
- do
- cookie="$REPLY
-"
- done
-}
-
function fetch_cookie () {
cookie=`cat $cookie_dir/$host.cookie`
}
if match TRUSTED $host
then
- [ $action == PUT ] && readcookie && store_cookie $host
+ [ $action == PUT ] && store_cookie $host
[ $action == GET ] && fetch_cookie && echo "$cookie"
elif ! match DENY $host
then
- [ $action == PUT ] && readcookie && zenity --question --title 'Uzbl Cookie handler' --text "Accept cookie from $host ? Contents:\n$cookie" && store_cookie $host
- [ $action == GET ] && fetch_cookie && zenity --question --title 'Uzbl Cookie handler' --text "Submit cookie to $host ? Contents:\n$cookie" && echo $cookie
+ [ $action == PUT ] && cookie=`zenity --entry --title 'Uzbl Cookie handler' --text "Accept this cookie from $host ?" --entry-text="$cookie"` && store_cookie $host
+ [ $action == GET ] && fetch_cookie && cookie=`zenity --entry --title 'Uzbl Cookie handler' --text "Submit this cookie to $host ?" --entry-text="$cookie"` && echo $cookie
fi
exit 0