I have a problem with a "html page" that has a form outside the <html>
tags. The page source goes something like this:
<form action="http://www.domain.com/cgi-bin/something.pl" NAME="dot"
METHOD="post">
<INPUT TYPE="hidden" NAME="x" value="25">
...
</form><script>document.forms["dot"].submit();</script>
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
...
I renders an error in Firefox 'cause the dot form isn't recognised
("document.form.dot has no propreties").
Is it possible to fix this with greasemonkey? I've tried a delayed
submit like the delayed helloworld in the dive into grease monkey with
same results.
If I do it ( document.forms['dot'].submit() ) from the java shell
after the page loads, it works.
Any ideas?
http://greasespot.arantius.com/XPCNativeWrapper#Expando_Properties
http://www.oreillynet.com/pub/a/network/2005/11/01/avoid-common-greasemonkey-pitfalls.html
Pitfall #3
This does not have to do with the location of the form in the HTML
source. If you open the DOM Inspector, you will see that Firefox
interprets and reorganizes the DOM so that HTML is the root element.
Your problem is "common Greasemonkey pitfall" number 3 from this
article: <http://www.oreillynet.com/lpt/a/6257> The fix is in the
section labeled Pitfall #3, but the whole article is pretty much
required reading for anybody writing Greasemonkey scripts.