Create a custom DNS error page
Asked Answered
R

1

5

I am building a new extension and I would like to customize the default error page in Google Chrome. I have gone through the "Override Pages" documentation here but have yet to find anything about customizing the page I have specified.

Any suggestions are much appreciated. Thank you.

The error page I want to customize is:

This webpage is not available

The server at ____ can't be found, because the DNS lookup failed. DNS is the network service that translates a website's name to its Internet address. This error is most often caused by having no connection to the Internet or a misconfigured network. It can also be caused by an unresponsive DNS server or a firewall preventing Google Chrome from accessing the network. Here are some suggestions: Reload this webpage later. Check your Internet connection. Restart any router, modem, or other network devices you may be using. Check your DNS settings. Contact your network administrator if you're not sure what this means. Try disabling network prediction by following these steps: Go to the wrench menu > Options > Under the Hood and deselect "Predict network actions to improve page load performance." If this does not resolve the issue, we recommend selecting this option again for improved performance. Add Google Chrome as a permitted program in your firewall's or antivirus software's settings. If it is already a permitted program, try deleting it from the list of permitted programs and adding it again. If you use a proxy server, check your proxy settings or contact your network administrator to make sure the proxy server is working. If you don't believe you should be using a proxy server, adjust your proxy settings: Go to the wrench menu > Options > Under the Hood > Change proxy settings... > LAN Settings and deselect the "Use a proxy server for your LAN" checkbox.

Error 105 (net::ERR_NAME_NOT_RESOLVED): Unable to resolve the server's DNS address.

Rau answered 15/12, 2011 at 3:48 Comment(0)
U
10

The chrome.override isn't meant for this. Instead you can detect a DNS resolution error using chrome.webRequest API. If you see this error you can load a different URL into the tab. Something along these lines:

chrome.webRequest.onErrorOccurred.addListener(onErrorOccurred, {urls: ["http://*/*", "https://*/*"]});

function onErrorOccurred(details)
{
  if (details.error == "net::ERR_NAME_NOT_RESOLVED")
    chrome.tabs.update(details.tabId, {url: "..."});
}
Undertaker answered 15/12, 2011 at 8:35 Comment(2)
Thanks a lot! I am developing an extension needs to hook this error. I never know this method before you point it out.Windblown
@Windblown what is the extension name?Sthilaire

© 2022 - 2024 — McMap. All rights reserved.