Detecting the Stop button

17 views
Skip to first unread message

David Regev

unread,
Aug 2, 2009, 12:09:16 AM8/2/09
to Noise (Firefox Extension)
How do I detect when the Stop button (or Esc key) is used to stop a
page from loading? I would guess that the event looks something like
this:
noise-WebProgress-stop&data==0x<some value>
but I have no idea how to figure out the proper value. Please note
that I would like the event to fire only when a load is interrupted,
not when Stop or Esc are used on a fully-loaded page.

Any suggestions?
Thanks again.

bootleq

unread,
Aug 2, 2009, 2:48:45 AM8/2/09
to noise-firef...@googlegroups.com
You can use something like
noise-WebProgress-stop&Components.utils.reportError(data)
to find the value (should be 2152398850), and with Mozilla Error Lookup we know the 0x value is 0x804B0002.

But there's another problem, in my test, the sound also fires when "undo close tab".

2009/8/2 David Regev <david...@gmail.com>

David Regev

unread,
Aug 2, 2009, 3:33:18 AM8/2/09
to Noise (Firefox Extension)
That was _very_ useful! The error code is, of course, the same value
as the hex output. That site’s error table[*] is even more
informative.

I got the same issues. The sound also fires when a tab is closed mid-
load, which makes sense, but is not very useful. The Undo Close Tab
issues is more annoying, though.

Thank you.


[*] http://silver.warwickcompsoc.co.uk/mozilla/misc/nserror_list
Reply all
Reply to author
Forward
0 new messages