gpt4 book ai didi

google-chrome-extension - 创建自定义 DNS 错误页面

转载 作者:行者123 更新时间:2023-12-04 06:55:43 25 4
gpt4 key购买 nike

我正在构建一个新的扩展程序,我想自定义 Google Chrome 中的默认错误页面。我已经浏览了“覆盖页面”文档 here但还没有找到任何关于自定义我指定的页面的信息。

任何建议都非常感谢。谢谢你。

我要自定义的错误页面是:

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.

最佳答案

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

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

关于google-chrome-extension - 创建自定义 DNS 错误页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8514883/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com