Greasemonkey script starts to early?

9 views
Skip to first unread message

BlackMatrix

unread,
Jul 6, 2008, 7:05:03 PM7/6/08
to greasemonkey-users
Hi. I like greasemonkey and I installed some scripts, but I have a
problem. When I go on a page, where I use a script, the script is
almost loaded to fast, because the page isn't really ready. What I
have to add, that the script starts a little bit later, maybe 2-3
secs?
I think all scripts start, when the page is ready, but the statusbar
of Firefox shows ready, 2 secs later, loading, then ready. So the
script starts when the first ready is shown, but it has to wait, till
the second or third "ready" is shown (2-3 secs later) What I have to
do?

Joachim Ott

unread,
Jul 7, 2008, 6:20:04 AM7/7/08
to greasemonkey-users
You'll have to wait, until the 2nd or 3rd load is done. Watch the
network traffic (with etheral, wireshark etc) what is being loaded.
Check for a specific element, and while it's not present, wait another
second with window.setTimeout().

BlackMatrix

unread,
Jul 7, 2008, 3:49:21 PM7/7/08
to greasemonkey-users
How to add a timeout in Javascript, I'm not familiar with Javascript :(

Keisial

unread,
Jul 7, 2008, 6:33:36 PM7/7/08
to greasemon...@googlegroups.com
BlackMatrix wrote:
> How to add a timeout in Javascript, I'm not familiar with Javascript :(
Look at setInterval() and setTimeout()

Reply all
Reply to author
Forward
0 new messages