зеркало из https://github.com/mozilla/pjs.git
bug 310696 suppress "view-source:" scheme in title, r=mconnor, sr=neil.parkwaycc
This commit is contained in:
Родитель
c3ccc1e015
Коммит
b2da9b7ab8
|
@ -583,12 +583,13 @@
|
||||||
// If location bar is hidden and the URL type supports a host,
|
// If location bar is hidden and the URL type supports a host,
|
||||||
// add the scheme and host to the title to prevent spoofing.
|
// add the scheme and host to the title to prevent spoofing.
|
||||||
// XXX https://bugzilla.mozilla.org/show_bug.cgi?id=22183#c239
|
// XXX https://bugzilla.mozilla.org/show_bug.cgi?id=22183#c239
|
||||||
|
// (only for schemes that support a host)
|
||||||
try {
|
try {
|
||||||
if (docElement.getAttribute("chromehidden").indexOf("location") != -1) {
|
if (docElement.getAttribute("chromehidden").indexOf("location") != -1) {
|
||||||
var host = this.mURIFixup.createExposableURI(
|
var uri = this.mURIFixup.createExposableURI(
|
||||||
this.mCurrentBrowser.currentURI).prePath;
|
this.mCurrentBrowser.currentURI);
|
||||||
if (host)
|
if (uri.host)
|
||||||
newTitle = host + sep + newTitle;
|
newTitle = uri.prePath + sep + newTitle;
|
||||||
}
|
}
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
|
||||||
|
|
|
@ -639,9 +639,12 @@ NS_IMETHODIMP nsContentTreeOwner::SetTitle(const PRUnichar* aTitle)
|
||||||
nsCOMPtr<nsIURI> tmpuri;
|
nsCOMPtr<nsIURI> tmpuri;
|
||||||
nsresult rv = fixup->CreateExposableURI(uri,getter_AddRefs(tmpuri));
|
nsresult rv = fixup->CreateExposableURI(uri,getter_AddRefs(tmpuri));
|
||||||
if (NS_SUCCEEDED(rv) && tmpuri) {
|
if (NS_SUCCEEDED(rv) && tmpuri) {
|
||||||
|
// (don't bother if there's no host)
|
||||||
|
nsCAutoString host;
|
||||||
nsCAutoString prepath;
|
nsCAutoString prepath;
|
||||||
|
tmpuri->GetHost(host);
|
||||||
tmpuri->GetPrePath(prepath);
|
tmpuri->GetPrePath(prepath);
|
||||||
if (!prepath.IsEmpty()) {
|
if (!host.IsEmpty()) {
|
||||||
//
|
//
|
||||||
// We have a scheme/host, update the title
|
// We have a scheme/host, update the title
|
||||||
//
|
//
|
||||||
|
|
|
@ -511,12 +511,13 @@
|
||||||
// If location bar is hidden and the URL type supports a host,
|
// If location bar is hidden and the URL type supports a host,
|
||||||
// add the scheme and host to the title to prevent spoofing.
|
// add the scheme and host to the title to prevent spoofing.
|
||||||
// XXX https://bugzilla.mozilla.org/show_bug.cgi?id=22183#c239
|
// XXX https://bugzilla.mozilla.org/show_bug.cgi?id=22183#c239
|
||||||
|
// (only for schemes that support a host)
|
||||||
try {
|
try {
|
||||||
if (docElement.getAttribute("chromehidden").indexOf("location") != -1) {
|
if (docElement.getAttribute("chromehidden").indexOf("location") != -1) {
|
||||||
var host = this.mURIFixup.createExposableURI(
|
var uri = this.mURIFixup.createExposableURI(
|
||||||
this.mCurrentBrowser.currentURI).prePath;
|
this.mCurrentBrowser.currentURI);
|
||||||
if (host)
|
if (uri.host)
|
||||||
newTitle = host + sep + newTitle;
|
newTitle = uri.prePath + sep + newTitle;
|
||||||
}
|
}
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче