user1196661
user1196661

Reputation: 13

Detecting connection reset in firefox

is there a way to detect "problem loading page" in firefox? i'd like to be able to know that the page load has failed and automatically reload the page. i'd also like to have a timed allowance for a page to load before the browser tries to reload it. i think this can be done by writing an add-on for firefox, but before i learn how to do that i want to know if it's even possible. all of the paths i have researched have only led me to things that are possible after the page has loaded. in this case the connection is aborted due to high traffic on the site requested and the page never loads.

Upvotes: 1

Views: 17557

Answers (1)

Wladimir Palant
Wladimir Palant

Reputation: 57651

You can use progress listeners. When a page finishes loading the onStateChange method of your progress listener will be called with STATE_STOP and STATE_IS_WINDOW flags set. You can check aStatus parameter then. For example, for a "connection reset" error it will have the value Components.results.NS_ERROR_NET_RESET.

See also: Network error codes

Upvotes: 2

Related Questions