views:

50

answers:

1

I want to run a Greasemonkey script on Firefox network error pages, such as (but not limited to) this one:

alt text

Can I do this with chrome:// URLs? If so, what are they? If not, is there another way?

+1  A: 

Well, I was almost on the right track. Two things:

  1. Network error pages begin with about:neterror, not chrome://. If you try to access ww.example.com (missing a w) then you will be redirected to about:neterror?e=dnsNotFound&u=http%3A//ww.example.com/&c=UTF-8&d=Firefox%20can%27t%20find%20the%20server%20at%20ww.example.com
  2. You cannot // @include about:neterror*.

But since we know the URL format, we can

// @include *

and check:

if (document.documentURI.search('about:neterror') != -1) {
    doStuffOnNetError();
}

Thanks for the hints, Brock.

Andrew Keeton
You're welcome and pretty nifty workaround.   verified that it does work on the *The connection was reset* condition, too. +1
Brock Adams