I trying to capture pageLoad event in progressListener, in onLocationChange i check URI of fresh page, and in case URI = about:blank i got
Error: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIURI.host]
As i understand this URI don't have host at all.
How can i check that host is available without raw parsing and exception catching? Is there any conventional way to check that atribute is present?
Your best bet is to filter certain protocols (filter on
scheme
). It's best to use a whitelist in this case of the protocols you care about.