Damien Leon - misc
Peter Suschlik - backwards searching
(salinasv) - move some variables to heap
+ Sylvester Johansson (scj) - original form filler script
Originaly based on http://trac.webkit.org/browser/trunk/WebKitTools/GtkLauncher/main.c
Which is copyrighted:
* regex style page searching? so you can do 'or' and 'and' things. flags like case sensitive etc.
* check for real command name, not just the first letter.
* let users attach handlers to the most common events/signals in uzbl.
+ great use case: automatically calling formfiller for certain sites
* write little script to open new urls with the urxvt url thing +document.
SOMEDAY:
bind XS = sh 'echo "act script alert (\\"This is sent by the shell via a fifo\\")" > "$4"'
+# this script allows you to load predefined values into html forms. (eg login information)
+# if you have no config file yet, it will let you create settings easily.
+bind z = spawn ./examples/scripts/formfiller.sh
+
# we ship some javascripts to do keyboard based link hinting/following. (webkit does not have C DOM bindings yet)
# this is similar to how it works in vimperator (and konqueror)
# TODO: did we resolve: "no click() event for hyperlinks so no referrer set" ?
--- /dev/null
+form_sent:
+redirect_url:
+req_username: <your username>
+req_password: <password>
+login:
#!/bin/bash
# simple login form filler for uzbl.
-# put your login information in the file $keydir/<domain>
+# put the form entry values you want to add (eg login information) in the file $keydir/<domain>
# in the format <fieldname>: <value>
+# (these files can be automatically created for you by setting editor and triggering this script on a site without a config)
-keydir=$XDG_CONFIG_HOME/uzbl/keys
-editor=gvim
+[ -d /usr/share/uzbl/examples/data/forms ] && keydir=/usr/share/uzbl/examples/data/forms # you will probably get permission denied errors here.
+[ -d $XDG_DATA_HOME/uzbl/forms ] && keydir=$XDG_DATA_HOME/uzbl/forms
+[ -d ./examples/data/forms ] && keydir=./examples/data/forms #useful when developing
+[ -z "$keydir" ] && exit 1
+
+#editor=gvim
+editor='urxvt -e vim'
config=$1; shift
-pid=$1; shift
-xid=$1; shift
-fifo=$1; shift
+pid=$1; shift
+xid=$1; shift
+fifo=$1; shift
socket=$1; shift
-url=$1; shift
-title=$1; shift
+url=$1; shift
+title=$1; shift
+
+[ -d $keydir ] || mkdir $keydir || exit 1
domain=$(echo $url | sed -re 's|(http\|https)+://([A-Za-z0-9\.]+)/.*|\2|')
if [[ -e $keydir/$domain ]]; then
- gawk -F': ' '{ print "act script document.getElementsByName(\"" $1 "\")[0].value = \"" $2 "\";"}' $keydir/$domain >> $fifo
+ gawk -F': ' '{ print "act js document.getElementsByName(\"" $1 "\")[0].value = \"" $2 "\";"}' $keydir/$domain >> $fifo
else
curl "$url" | grep '<input' | sed -nre 's|.*<input.*?name="([[:graph:]]+)".*?/>.*|\1: |p' > $keydir/$domain
$editor $keydir/$domain