Code outside <html> tags

19 views
Skip to first unread message

iceburn_tuga

unread,
Feb 20, 2007, 2:07:50 PM2/20/07
to greasemonkey-users
Hi,

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?

Anthony Lieuallen

unread,
Feb 20, 2007, 3:19:46 PM2/20/07
to greasemon...@googlegroups.com
On 2/20/2007 2:07 PM, iceburn_tuga wrote:
> ... the dot form isn't recognised

> ("document.form.dot has no propreties").

http://greasespot.arantius.com/XPCNativeWrapper#Expando_Properties

http://www.oreillynet.com/pub/a/network/2005/11/01/avoid-common-greasemonkey-pitfalls.html

Pitfall #3

Lenny Domnitser

unread,
Feb 20, 2007, 3:25:04 PM2/20/07
to greasemon...@googlegroups.com
On 2/20/07, iceburn_tuga <joaor...@gmail.com> wrote:
> 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.

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.

iceburn_tuga

unread,
Feb 22, 2007, 7:43:01 AM2/22/07
to greasemonkey-users
Thanks a lot guys. That did the trick

Reply all
Reply to author
Forward
0 new messages