From bad10238ec7acca17801a89639472ff46b8163a5 Mon Sep 17 00:00:00 2001 From: "waterson%netscape.com" Date: Mon, 15 May 2000 06:14:32 +0000 Subject: [PATCH] Bug 39089. Paint over the problem by special-casing 'javascript:' URIs. r=mscott git-svn-id: svn://10.0.0.236/trunk@69752 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/nsDocShell.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index 7e16a0528f0..ab45e8e8ae3 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -2528,7 +2528,15 @@ NS_IMETHODIMP nsDocShell::DoURILoad(nsIURI* aURI, nsIURI* aReferrerURI, } //XXX Wrong, but needed for now. See bug 31818. - channel->SetOriginalURI(aReferrerURI ? aReferrerURI : aURI); + static const char kJavaScriptScheme[] = "javascript"; + nsXPIDLCString scheme; + aURI->GetScheme(getter_Copies(scheme)); + if (0 == PL_strncmp(NS_STATIC_CAST(const char*, scheme), kJavaScriptScheme, sizeof(kJavaScriptScheme) - 1)) { + channel->SetOriginalURI(aReferrerURI ? aReferrerURI : aURI); + } + else { + channel->SetOriginalURI(aURI); + } // Mark the channel as being a document URI... nsLoadFlags loadAttribs = 0;