위생병은이 주제를 보지 못했습니다. 다음은이 약을 찾아 할 수있는 방법은 다음과 같습니다 mozillaZine :: Detecting “problem loading page” in firefox
브라우저의 webNavigation을 통해 docuri을 읽을 수 있습니다에서 neterror로드
. window.location이 다르기 때문에
어쨌든 docuri는 오류가 발생했을 때 정말 멋지다. e 매개 변수에서 문제가 무엇인지 분명하게 알려줍니다.
about:neterror?e=dnsNotFound&u=http%3A//www.cu.reporterror%28%27afew/&c=UTF-8&d=Firefox%20can%27t%20find%20the%20server%20at%20www.cu.reporterror%28%27afew.
about:neterror?e=malformedURI&u=about%3Abalk&c=&d=The%20URL%20is%20not%20valid%20and%20cannot%
당신이 malformedURI
var listenToPageLoad_IfProblemLoadingPage = function(event) {
var win = event.originalTarget.defaultView;
var webnav = win.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIWebNavigation);
//console.log('webnav:', webnav, 'webnav of selectedtab:', window.gBrowser.webNavigation);
var docuri = webnav.document.documentURI; //can also try event.originalTarget.linkedBrowser.webNavigation.document.documentURI <<i didnt test this linkedBrowser theory but its gotta be something like that
var location = win.location + ''; //I add a " + ''" at the end so it makes it a string so we can use string functions like location.indexOf etc
if (win.frameElement) {
// Frame within a tab was loaded. win should be the top window of
// the frameset. If you don't want do anything when frames/iframes
// are loaded in this web page, uncomment the following line:
// return;
// Find the root document:
//win = win.top;
if (docuri.indexOf('about:neterror') == 0) {
Components.utils.reportError('IN FRAME - PROBLEM LOADING PAGE LOADED docuri = "' + docuri + '"');
}
} else {
if (docuri.indexOf('about:neterror') == 0) {
Components.utils.reportError('IN TAB - PROBLEM LOADING PAGE LOADED docuri = "' + docuri + '"');
}
}
}
window.gBrowser.addEventListener('DOMContentLoaded', listenToPageLoad_IfProblemLoadingPage, false);
내가 생각할 수있는 유일한 해결책은 병렬 [을 확인하는 것입니다 첫 번째는 dnsNotFound이고, 두 번째는 볼 수 theese는 부하 docuris 몇 가지의 예 요청] (https://developer.mozilla.org/ko-KR/Add-ons/SDK/High-Level_APIs/request)을 방문하여 응답이 무엇인지 확인한 다음 중복 요청을하면 느낄 수 있습니다 느린 연결에서. – willlma