зеркало из https://github.com/mozilla/gecko-dev.git
77315 - Make send page grab the correct document title.
r=sicking sr=bzbarsky
This commit is contained in:
Родитель
9456212b6b
Коммит
b775400b9c
|
@ -583,7 +583,7 @@ function GetSuggestedFileName(aDocumentURLString, aMIMEType, aHTMLDoc)
|
|||
}
|
||||
|
||||
// check if there is a title we can use
|
||||
var title = aHTMLDoc.title;
|
||||
var title = Components.lookupMethod(aHTMLDoc, 'title').call(aHTMLDoc);
|
||||
if (title.length > 0) // we have a title; let's see if it's usable
|
||||
{
|
||||
// clean up the title to make it a usable filename
|
||||
|
@ -686,7 +686,7 @@ function PromptAndSetTitleIfNone(aHTMLDoc)
|
|||
{
|
||||
if (!aHTMLDoc) throw NS_ERROR_NULL_POINTER;
|
||||
|
||||
var title = aHTMLDoc.title;
|
||||
var title = Components.lookupMethod(aHTMLDoc, 'title').call(aHTMLDoc);
|
||||
if (title.length > 0) // we have a title; no need to prompt!
|
||||
return true;
|
||||
|
||||
|
@ -1948,7 +1948,8 @@ var nsSendPageCommand =
|
|||
if (DocumentHasBeenSaved())
|
||||
{
|
||||
// Launch Messenger Composer window with current page as contents
|
||||
var pageTitle = window.editorShell.editorDocument.title;
|
||||
var pageDoc = window.editorShell.editorDocument;
|
||||
var pageTitle = Components.lookupMethod(pageDoc, 'title').call(pageDoc);
|
||||
var pageUrl = GetDocumentUrl();
|
||||
try
|
||||
{
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
aDocument = window._content.document;
|
||||
|
||||
var pageUrl = aDocument.URL;
|
||||
var pageTitle = aDocument.title;
|
||||
var pageTitle = Components.lookupMethod(aDocument, 'title').call(aDocument);
|
||||
|
||||
try {
|
||||
openComposeWindow(pageUrl, pageTitle, 1);
|
||||
|
@ -119,7 +119,9 @@
|
|||
<!-- navigator specific commands -->
|
||||
<commandset id="tasksCommands">
|
||||
<command id="cmd_sendPage" oncommand="sendPage();"/>
|
||||
<command id="Browser:SendLink" oncommand="sendLink(window._content.location.href, window._content.document.title);"/>
|
||||
<command id="Browser:SendLink"
|
||||
oncommand="sendLink(Components.lookupMethod(window._content, 'location').call(window._content).href,
|
||||
Components.lookupMethod(window._content.document, 'title').call(window._content.document);"/>
|
||||
</commandset>
|
||||
|
||||
<!-- navigator specific UI items -->
|
||||
|
|
Загрузка…
Ссылка в новой задаче