Bug 277658 - Make error pages URL a preference.
r=biesi sr=bz p=bugmail@q1n.org (Vidar Braut Haarr) git-svn-id: svn://10.0.0.236/trunk@168714 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -3016,18 +3016,30 @@ 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);
|
||||
|
||||
nsAutoString errorPageUrl;
|
||||
nsXPIDLCString errorPageUrl;
|
||||
|
||||
errorPageUrl.AssignLiteral("chrome://global/content/netError.xhtml?e=");
|
||||
nsCOMPtr<nsIPrefBranch> 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);
|
||||
errorPageUrl.AppendLiteral("&d=");
|
||||
errorPageUrl.AppendASCII(escapedDescription);
|
||||
|
||||
PR_FREEIF(escapedDescription);
|
||||
PR_FREEIF(escapedError);
|
||||
PR_FREEIF(escapedUrl);
|
||||
nsMemory::Free(escapedDescription);
|
||||
nsMemory::Free(escapedError);
|
||||
nsMemory::Free(escapedUrl);
|
||||
|
||||
nsCOMPtr<nsIURI> errorPageURI;
|
||||
nsresult rv = NS_NewURI(getter_AddRefs(errorPageURI), errorPageUrl);
|
||||
|
||||
Reference in New Issue
Block a user