зеркало из https://github.com/mozilla/pjs.git
locationless windows need hostname in titlebar (match 1.0x -- bug 304388) r=mconnor/jruderman, sr=bzbarsky
This commit is contained in:
Родитель
6b4d851da9
Коммит
d31927916f
|
@ -562,21 +562,36 @@
|
|||
<![CDATA[
|
||||
var newTitle = "";
|
||||
var docTitle;
|
||||
var docElement = this.ownerDocument.documentElement;
|
||||
var sep = docElement.getAttribute("titlemenuseparator");
|
||||
|
||||
if (this.docShell.contentViewer)
|
||||
docTitle = this.contentTitle;
|
||||
|
||||
if (!docTitle)
|
||||
docTitle = this.ownerDocument.documentElement.getAttribute("titledefault");
|
||||
docTitle = docElement.getAttribute("titledefault");
|
||||
|
||||
var modifier = this.ownerDocument.documentElement.getAttribute("titlemodifier");
|
||||
var modifier = docElement.getAttribute("titlemodifier");
|
||||
if (docTitle) {
|
||||
newTitle += this.ownerDocument.documentElement.getAttribute("titlepreface");
|
||||
newTitle += docElement.getAttribute("titlepreface");
|
||||
newTitle += docTitle;
|
||||
var sep = this.ownerDocument.documentElement.getAttribute("titlemenuseparator");
|
||||
if (modifier)
|
||||
newTitle += sep;
|
||||
}
|
||||
newTitle += modifier;
|
||||
|
||||
// If location bar is hidden and the URL type supports a host,
|
||||
// add the scheme and host to the title to prevent spoofing.
|
||||
// XXX https://bugzilla.mozilla.org/show_bug.cgi?id=22183#c239
|
||||
try {
|
||||
if (docElement.getAttribute("chromehidden").indexOf("location") != -1) {
|
||||
var host = this.mURIFixup.createExposableURI(
|
||||
this.mCurrentBrowser.currentURI).prePath;
|
||||
if (host)
|
||||
newTitle = host + sep + newTitle;
|
||||
}
|
||||
} catch (e) {}
|
||||
|
||||
this.ownerDocument.title = newTitle;
|
||||
]]>
|
||||
</body>
|
||||
|
|
Загрузка…
Ссылка в новой задаче