diff --git a/mozilla/caps/src/nsScriptSecurityManager.cpp b/mozilla/caps/src/nsScriptSecurityManager.cpp index b10888c4d60..bb770d2f4a5 100644 --- a/mozilla/caps/src/nsScriptSecurityManager.cpp +++ b/mozilla/caps/src/nsScriptSecurityManager.cpp @@ -1566,7 +1566,8 @@ nsScriptSecurityManager::CanExecuteScripts(JSContext* cx, { nsCAutoString spec; principalURI->GetSpec(spec); - if (spec.EqualsLiteral("about:")) + if (spec.EqualsLiteral("about:") || + StringBeginsWith(spec, NS_LITERAL_CSTRING("about:neterror?"))) { *result = PR_TRUE; return NS_OK; diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index 37c262cd102..5701d4be2bf 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -3051,21 +3051,8 @@ nsDocShell::LoadErrorPage(nsIURI *aURI, const PRUnichar *aURL, char *escapedError = nsEscape(NS_ConvertUTF16toUTF8(aErrorType).get(), url_Path); char *escapedDescription = nsEscape(NS_ConvertUTF16toUTF8(aDescription).get(), url_Path); - nsXPIDLCString errorPageUrl; + nsCString errorPageUrl("about:neterror?e="); - nsCOMPtr prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID)); - if (prefBranch) - { - // Note that we don't expose this pref, because we don't want users fiddling with it. - prefBranch->GetCharPref("browser.xul.error_pages.location", getter_Copies(errorPageUrl)); - } - - if (errorPageUrl.IsEmpty()) - { - errorPageUrl.AssignLiteral("chrome://global/content/netError.xhtml"); - } - - errorPageUrl.AppendLiteral("?e="); errorPageUrl.AppendASCII(escapedError); errorPageUrl.AppendLiteral("&u="); errorPageUrl.AppendASCII(escapedUrl); diff --git a/mozilla/docshell/resources/content/jar.mn b/mozilla/docshell/resources/content/jar.mn index 58fed605d4e..f1641c86010 100644 --- a/mozilla/docshell/resources/content/jar.mn +++ b/mozilla/docshell/resources/content/jar.mn @@ -1,3 +1,2 @@ toolkit.jar: content/global/netError.xhtml - content/global/netError.js diff --git a/mozilla/docshell/resources/content/netError.js b/mozilla/docshell/resources/content/netError.js deleted file mode 100644 index db0dc9c6c66..00000000000 --- a/mozilla/docshell/resources/content/netError.js +++ /dev/null @@ -1,81 +0,0 @@ -// Error url MUST be formatted like this: -// chrome://neterror.xhtml?e=error&u=url&d=desc - -// Note that this file uses document.documentURI to get -// the URL (with the format from above). This is because -// document.location.href gets the current URI off the docshell, -// which is the URL displayed in the location bar, i.e. -// the URI that the user attempted to load. - -function getErrorCode() -{ - var url = document.documentURI; - var error = url.search(/e\=/); - var duffUrl = url.search(/\&u\=/); - return decodeURIComponent(url.slice(error + 2, duffUrl)); -} - -function getDuffUrl() -{ - var url = document.documentURI; - var duffUrl = url.search(/u\=/); - var desc = url.search(/\&d\=/); - return decodeURIComponent(url.slice(duffUrl + 2, desc)); -} - -function getDescription() -{ - var url = document.documentURI; - var desc = url.search(/d\=/); - return decodeURIComponent(url.slice(desc + 2)); -} - -function retryThis() -{ - // Session history has the URL of the page that failed - // to load, not the one of the error page. So, just call - // reload(), which will also repost POST data correctly. - location.reload(); -} - -function fillIn() -{ - var err = getErrorCode(); - var duffUrl = getDuffUrl(); - var i; - - // Fill in the title - var et = document.getElementById("et_" + err); - if (et) { - et.className = "et_visible"; - } - - -// for (i = 0; i < t.childNodes.length; i++) -// { -// var n = t.childNodes.item(i); -// if (n.nodeType == Node.TEXT_NODE) -// { -// n.nodeValue = titleText; -// break; -// } -// } - - // Fill in the short description - var sd = document.getElementById("shortDesc"); - for (i = 0; i < sd.childNodes.length; i++) - { - var n = sd.childNodes.item(i); - if (n.nodeType == Node.TEXT_NODE) - { - n.nodeValue = getDescription(); - break; - } - } - - // Long description - var ld = document.getElementById("ld_" + err); - if (ld) { - ld.className = "ld_visible"; - } -} diff --git a/mozilla/docshell/resources/content/netError.xhtml b/mozilla/docshell/resources/content/netError.xhtml index 2bc4317ad7d..171a4fde773 100644 --- a/mozilla/docshell/resources/content/netError.xhtml +++ b/mozilla/docshell/resources/content/netError.xhtml @@ -51,7 +51,6 @@ &loadError.label; -