diff options
author | Pawel Tomak <satherot@gmail.com> | 2010-03-14 14:07:52 +0100 |
---|---|---|
committer | Mason Larobina <mason.larobina@gmail.com> | 2010-03-15 03:17:12 +0800 |
commit | d1d4adb6bd33d70936a79d202552ef9e50e9f3b9 (patch) | |
tree | e4463a5a636f24974ef6da1606f3ac2aac479502 /examples/data | |
parent | 616e583c8c6fc80c2b7eef2da3329af851f34b6f (diff) |
Try .. catch sections to catch errors raised by accessing (i)frames from other
domains
Diffstat (limited to 'examples/data')
-rwxr-xr-x | examples/data/scripts/eFormFiller.sh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/data/scripts/eFormFiller.sh b/examples/data/scripts/eFormFiller.sh index 64932a3..c7c286e 100755 --- a/examples/data/scripts/eFormFiller.sh +++ b/examples/data/scripts/eFormFiller.sh @@ -86,12 +86,12 @@ then cat $keydir/$domain | \ sed -n -e "/^!profile=${option}/,/^!profile=/p" | \ - sed -n -e 's/\([^(]\+\)([^)]\+):[ ]*\(.\+\)$/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 -n -e 's/\([^(]\+\)([^)]\+):[ ]*\(.\+\)$/js if(window.frames.length > 0) { for(i=0;i<window.frames.length;i=i+1) { try { var e = window.frames[i].document.getElementsByName("\1"); if(e.length > 0) { e[0].value="\2"; } } catch(err) { } } }; 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 } }' | \ + 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' | \ socat - unix-connect:$socket` @@ -111,7 +111,7 @@ then [ -e $tmpfile ] || exit 2 cat $tmpfile | \ - sed -n -e 's/\([^(]\+\)([^)]\+):[ ]*\(.\+\)/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 -n -e 's/\([^(]\+\)([^)]\+):[ ]*\(.\+\)/js if(window.frames.length > 0) { for(i=0;i<window.frames.length;i=i+1) { try { var e = window.frames[i].document.getElementsByName("\1"); if(e.length > 0) { e[0].value="\2" } } catch(err) { } } }; document.getElementsByName("\1")[0].value="\2"/p' | \ sed -e 's/@/\\@/g' >> $fifo rm -f $tmpfile else @@ -139,7 +139,7 @@ else # login(text): # passwd(password): # - html=`echo 'js if(window.frames.length > 0) { for(i=0;i<window.frames.length;i=i+1) { window.frames[i].document.documentElement.outerHTML } }' | \ + 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' | \ socat - unix-connect:$socket` |