aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorGravatar Pawel Tomak <satherot@gmail.com>2010-03-10 21:41:42 +0100
committerGravatar Pawel Tomak <satherot@gmail.com>2010-03-10 21:41:42 +0100
commitbb862588a60e48ac47759b0b8fda36d9a0775df8 (patch)
treea76037bf22846d93946a9c12a071a9c61edb6649 /examples
parent2dd9f3286885cf7685f66d2f818ad463fbae905c (diff)
Better support for framed pages
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/data/scripts/eFormFiller.sh32
1 files changed, 19 insertions, 13 deletions
diff --git a/examples/data/scripts/eFormFiller.sh b/examples/data/scripts/eFormFiller.sh
index 3425716..b78a99b 100755
--- a/examples/data/scripts/eFormFiller.sh
+++ b/examples/data/scripts/eFormFiller.sh
@@ -45,19 +45,19 @@ if [ -z ${editor} ]; then
fi
fi
-config=$1;
+config=$1;
shift
-pid=$1;
+pid=$1;
shift
-xid=$1;
+xid=$1;
shift
-fifo=$1;
+fifo=$1;
shift
-socket=$1;
+socket=$1;
shift
-url=$1;
+url=$1;
shift
-title=$1;
+title=$1;
shift
action=$1
@@ -86,13 +86,16 @@ then
cat $keydir/$domain | \
sed -n -e "/^!profile=${option}/,/^!profile=/p" | \
- sed -n -e 's/\([^(]\+\)([^)]\+):[ ]*\([^[:blank:]]\+\)/js if(window.frames.length > 0) { for(i=0;i<window.frames.length;i=i+1) { var e = window.frames[i].document.getElementsByName("\1"); if(e.length > 0) { e[0].value="\2" } } } else document.getElementsByName("\1")[0].value="\2"/p' | \
+ sed -n -e 's/\([^(]\+\)([^)]\+):[ ]*\([^[:blank:]]\+\)/js if(window.frames.length > 0) { for(i=0;i<window.frames.length;i=i+1) { var e = window.frames[i].document.getElementsByName("\1"); if(e.length > 0) { e[0].value="\2" } } }; document.getElementsByName("\1")[0].value="\2"/p' | \
sed -e 's/@/\\@/g' >> $fifo
elif [ "$action" = "once" ]
then
tmpfile=`mktemp`
- html=`echo 'js if(window.frames.length > 0) { for(i=0;i<window.frames.length;i=i+1) { window.frames[i].document.documentElement.outerHTML } } else document.documentElement.outerHTML;' | \
- socat - unix-connect:$socket | \
+ html=`echo 'js if(window.frames.length > 0) { for(i=0;i<window.frames.length;i=i+1) { window.frames[i].document.documentElement.outerHTML } }' | \
+ socat - unix-connect:$socket`
+ html=${html}" "`echo 'js document.documentElement.outerHTML' | \
+ socat - unix-connect:$socket`
+ html=`echo ${html} | \
tr -d '\n' | \
sed 's/>/>\n/g' | \
sed 's/<input/<input type="text"/g' | \
@@ -108,7 +111,7 @@ then
[ -e $tmpfile ] || exit 2
cat $tmpfile | \
- sed -n -e 's/\([^(]\+\)([^)]\+):[ ]*\([^[:blank:]]\+\)/js if(window.frames.length > 0) { for(i=0;i<window.frames.length;i=i+1) { var e = window.frames[i].document.getElementsByName("\1"); if(e.length > 0) { e[0].value="\2" } } } else document.getElementsByName("\1")[0].value="\2"/p' | \
+ sed -n -e 's/\([^(]\+\)([^)]\+):[ ]*\([^[:blank:]]\+\)/js if(window.frames.length > 0) { for(i=0;i<window.frames.length;i=i+1) { var e = window.frames[i].document.getElementsByName("\1"); if(e.length > 0) { e[0].value="\2" } } }; document.getElementsByName("\1")[0].value="\2"/p' | \
sed -e 's/@/\\@/g' >> $fifo
rm -f $tmpfile
else
@@ -136,8 +139,11 @@ else
# login(text):
# passwd(password):
#
- echo 'js if(window.frames.length > 0) { for(i=0;i<window.frames.length;i=i+1) { window.frames[i].document.documentElement.outerHTML } } else document.documentElement.outerHTML;' | \
- socat - unix-connect:$socket | \
+ html=`echo 'js if(window.frames.length > 0) { for(i=0;i<window.frames.length;i=i+1) { window.frames[i].document.documentElement.outerHTML } }' | \
+ socat - unix-connect:$socket`
+ html=${html}" "`echo 'js document.documentElement.outerHTML' | \
+ socat - unix-connect:$socket`
+ echo ${html} | \
tr -d '\n' | \
sed 's/>/>\n/g' | \
sed 's/<input/<input type="text"/g' | \