зеркало из https://github.com/mozilla/gecko-dev.git
Camino only - Don't show wyciwyg URLs in location bar. Patch by smorgan <stuart.morgan@alumni.case.edu> r=hwaara sr=pink b=306396
This commit is contained in:
Родитель
a723cfe070
Коммит
c05e66e7a3
|
@ -135,3 +135,6 @@ pref("browser.link.open_newwindow.restriction", 2);
|
||||||
|
|
||||||
// enable popup blocking
|
// enable popup blocking
|
||||||
pref("dom.disable_open_during_load", true);
|
pref("dom.disable_open_during_load", true);
|
||||||
|
|
||||||
|
// don't hide user:pass when fixing up URIs
|
||||||
|
pref("browser.fixup.hide_user_pass", false);
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
|
|
||||||
#include "nsDownloadListener.h"
|
#include "nsDownloadListener.h"
|
||||||
|
|
||||||
|
#include "nsIURIFixup.h"
|
||||||
#include "nsIWebProgress.h"
|
#include "nsIWebProgress.h"
|
||||||
#include "nsIFileURL.h"
|
#include "nsIFileURL.h"
|
||||||
#include "netCore.h"
|
#include "netCore.h"
|
||||||
|
@ -312,8 +313,14 @@ nsDownloadListener::InitDialog()
|
||||||
spec.Append(hostport);
|
spec.Append(hostport);
|
||||||
spec.Append(path);
|
spec.Append(path);
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
mURI->GetSpec(spec);
|
nsCOMPtr<nsIURI> exposableURI;
|
||||||
|
nsCOMPtr<nsIURIFixup> fixup(do_GetService("@mozilla.org/docshell/urifixup;1"));
|
||||||
|
if (fixup && NS_SUCCEEDED(fixup->CreateExposableURI(mURI, getter_AddRefs(exposableURI))) && exposableURI)
|
||||||
|
exposableURI->GetSpec(spec);
|
||||||
|
else
|
||||||
|
mURI->GetSpec(spec);
|
||||||
|
}
|
||||||
|
|
||||||
[mDownloadDisplay setSourceURL: [NSString stringWithUTF8String:spec.get()]];
|
[mDownloadDisplay setSourceURL: [NSString stringWithUTF8String:spec.get()]];
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,6 +46,7 @@
|
||||||
#include "nsIWebNavigation.h"
|
#include "nsIWebNavigation.h"
|
||||||
#include "nsIWebProgress.h"
|
#include "nsIWebProgress.h"
|
||||||
#include "nsIURI.h"
|
#include "nsIURI.h"
|
||||||
|
#include "nsIURIFixup.h"
|
||||||
#include "nsIDOMElement.h"
|
#include "nsIDOMElement.h"
|
||||||
#include "nsIDOMWindow.h"
|
#include "nsIDOMWindow.h"
|
||||||
#include "nsIDOMDocument.h"
|
#include "nsIDOMDocument.h"
|
||||||
|
@ -708,7 +709,13 @@ CHBrowserListener::OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aR
|
||||||
}
|
}
|
||||||
|
|
||||||
nsCAutoString spec;
|
nsCAutoString spec;
|
||||||
aLocation->GetSpec(spec);
|
nsCOMPtr<nsIURI> exposableLocation;
|
||||||
|
nsCOMPtr<nsIURIFixup> fixup(do_GetService("@mozilla.org/docshell/urifixup;1"));
|
||||||
|
if (fixup && NS_SUCCEEDED(fixup->CreateExposableURI(aLocation, getter_AddRefs(exposableLocation))) && exposableLocation)
|
||||||
|
exposableLocation->GetSpec(spec);
|
||||||
|
else
|
||||||
|
aLocation->GetSpec(spec);
|
||||||
|
|
||||||
NSString* str = [NSString stringWithUTF8String:spec.get()];
|
NSString* str = [NSString stringWithUTF8String:spec.get()];
|
||||||
|
|
||||||
NSEnumerator* enumerator = [mListeners objectEnumerator];
|
NSEnumerator* enumerator = [mListeners objectEnumerator];
|
||||||
|
|
|
@ -51,6 +51,7 @@
|
||||||
#include "nsIDocCharset.h"
|
#include "nsIDocCharset.h"
|
||||||
|
|
||||||
#include "nsIURI.h"
|
#include "nsIURI.h"
|
||||||
|
#include "nsIURIFixup.h"
|
||||||
#include "nsIDocument.h"
|
#include "nsIDocument.h"
|
||||||
#include "nsIDOMWindow.h"
|
#include "nsIDOMWindow.h"
|
||||||
#include "nsPIDOMWindow.h"
|
#include "nsPIDOMWindow.h"
|
||||||
|
@ -537,6 +538,10 @@ const long NSFindPanelActionSetFindString = 7;
|
||||||
browserSetup->SetProperty(property, value);
|
browserSetup->SetProperty(property, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Gets the current URI in fixed-up form, suitable for display to the user.
|
||||||
|
// In the case of wyciwyg: URIs, this will not be the actual URI of the page
|
||||||
|
// according to gecko.
|
||||||
|
//
|
||||||
// should we be using the window.location URL instead? see nsIDOMLocation.h
|
// should we be using the window.location URL instead? see nsIDOMLocation.h
|
||||||
- (NSString*)getCurrentURI
|
- (NSString*)getCurrentURI
|
||||||
{
|
{
|
||||||
|
@ -550,7 +555,13 @@ const long NSFindPanelActionSetFindString = 7;
|
||||||
return @"";
|
return @"";
|
||||||
|
|
||||||
nsCAutoString spec;
|
nsCAutoString spec;
|
||||||
uri->GetSpec(spec);
|
nsCOMPtr<nsIURI> exposableURI;
|
||||||
|
nsCOMPtr<nsIURIFixup> fixup(do_GetService("@mozilla.org/docshell/urifixup;1"));
|
||||||
|
if (fixup && NS_SUCCEEDED(fixup->CreateExposableURI(uri, getter_AddRefs(exposableURI))) && exposableURI)
|
||||||
|
exposableURI->GetSpec(spec);
|
||||||
|
else
|
||||||
|
uri->GetSpec(spec);
|
||||||
|
|
||||||
return [NSString stringWithUTF8String:spec.get()];
|
return [NSString stringWithUTF8String:spec.get()];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче