diff options
author | Paweł Zuzelski <pawelz@pld-linux.org> | 2010-03-26 21:14:30 +0100 |
---|---|---|
committer | Paweł Zuzelski <pawelz@pld-linux.org> | 2010-03-26 21:14:30 +0100 |
commit | 509fb1b749047cff1488b8eef18336bbfb9a46d5 (patch) | |
tree | 1193e375026606beb34b1ff20e845725482ef76a /examples/data/scripts/formfiller.sh | |
parent | f4b8407266146d0ede957a3f1925416b288371eb (diff) | |
parent | f18b80263ad72f432d9127f3025ea85bf89e87c7 (diff) |
Merge remote branch 'grodzik/experimental' into experimental
Diffstat (limited to 'examples/data/scripts/formfiller.sh')
-rwxr-xr-x | examples/data/scripts/formfiller.sh | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/examples/data/scripts/formfiller.sh b/examples/data/scripts/formfiller.sh index 5dc6345..4b62ea1 100755 --- a/examples/data/scripts/formfiller.sh +++ b/examples/data/scripts/formfiller.sh @@ -74,6 +74,8 @@ then action="new" fi +dumpFunction='function dump() { var output = ""; var allFrames = new Array(window); for(f=0;f<window.frames.length;f=f+1) { allFrames.push(window.frames[f]); }; for(j=0;j<allFrames.length;j=j+1) { try { var myf = allFrames[j].document.forms; if(myf.length > 0) { for(k=0;k<myf.length;k=k+1) { output = output + myf[k].outerHTML; } } } catch(err) { } } return output; }; ' + if [ "$action" = 'load' ] then [ -e $keydir/$domain ] || exit 2 @@ -91,9 +93,7 @@ then elif [ "$action" = "once" ] then tmpfile=`mktemp` - html=`echo 'js if(window.frames.length > 0) { for(j=0;j<window.frames.length;j=j+1) { try { window.frames[j].document.documentElement.outerHTML; } catch(err) { } } }' | \ - socat - unix-connect:$socket` - html=${html}" "`echo 'js document.documentElement.outerHTML' | \ + html=`echo 'js '${dumpFunction}' dump(); ' | \ socat - unix-connect:$socket` html=`echo ${html} | \ tr -d '\n' | \ @@ -143,9 +143,7 @@ else # login(text): # passwd(password): # - html=`echo 'js if(window.frames.length > 0) { for(i=0;i<window.frames.length;i=i+1) { try { window.frames[i].document.documentElement.outerHTML; } catch(err) { } } }' | \ - socat - unix-connect:$socket` - html=${html}" "`echo 'js document.documentElement.outerHTML' | \ + html=`echo 'js '${dumpFunction}' dump(); ' | \ socat - unix-connect:$socket` echo ${html} | \ tr -d '\n' | \ |