创建自定义 DNS 错误页面 [英] Create a custom DNS error page

查看:19
本文介绍了创建自定义 DNS 错误页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个新的扩展程序,我想自定义 Google Chrome 中的默认错误页面.我已经浏览了覆盖页面"文档此处,但还没有找到任何内容关于自定义我指定的页面.

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:

此网页不可用

找不到位于 ____ 的服务器,因为 DNS 查找失败的.DNS 是一种网络服务,可将网站名称转换为它的互联网地址.此错误通常是由于没有连接到 Internet 或错误配置的网络.也可以由无响应的 DNS 服务器或阻止 Google 的防火墙引起Chrome 无法访问网络.以下是一些建议: 重新加载此网页稍后.检查您的互联网连接.重启任何您可能正在使用的路由器、调制解调器或其他网络设备.检查你的DNS 设置.如果您不确定,请联系您的网络管理员这是什么意思.尝试按照以下步骤禁用网络预测步骤:转到扳手菜单 > 选项 > 引擎盖下并取消选择预测网络操作以提高页面加载性能."如果这不能解决问题,我们建议再次选择此选项以提高性能.将 Google Chrome 添加为允许的程序您的防火墙或防病毒软件的设置.如果它已经是一个允许的程序,尝试从允许的程序列表中删除它并再次添加.如果您使用代理服务器,请检查您的代理设置或联系您的网络管理员以确保代理服务器正在工作.如果你不相信你应该使用代理服务器,调整您的代理设置:转到扳手菜单 > 选项 >在引擎盖下 > 更改代理设置... > LAN 设置并取消选择为您的 LAN 使用代理服务器"复选框.

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.

错误 105 (net::ERR_NAME_NOT_RESOLVED):无法解析服务器的DNS 地址.

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

推荐答案

chrome.override 不是为了这个.相反,您可以使用 chrome.webRequest API 检测 DNS 解析错误.如果您看到此错误,您可以将不同的 URL 加载到选项卡中.一些类似的东西:

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: "..."});
}

这篇关于创建自定义 DNS 错误页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆