Bug 1088540, fix email link for content processes, r=gijs
--- a/browser/base/content/browser-sets.inc
+++ b/browser/base/content/browser-sets.inc
@@ -20,17 +20,17 @@
<command id="cmd_handleBackspace" oncommand="BrowserHandleBackspace();" />
<command id="cmd_handleShiftBackspace" oncommand="BrowserHandleShiftBackspace();" />
<command id="cmd_newNavigatorTab" oncommand="BrowserOpenNewTabOrWindow(event);"/>
<command id="Browser:OpenFile" oncommand="BrowserOpenFileWindow();"/>
<command id="Browser:SavePage" oncommand="saveDocument(gBrowser.selectedBrowser.contentDocumentAsCPOW);"/>
<command id="Browser:SendLink"
- oncommand="MailIntegration.sendLinkForWindow(window.content);"/>
+ oncommand="MailIntegration.sendLinkForBrowser(gBrowser.selectedBrowser);"/>
<command id="cmd_pageSetup" oncommand="PrintUtils.showPageSetup();"/>
<command id="cmd_print" oncommand="PrintUtils.print(window.gBrowser.selectedBrowser.contentWindowAsCPOW, window.gBrowser.selectedBrowser);"/>
<command id="cmd_printPreview" oncommand="PrintUtils.printPreview(PrintPreviewListener);"/>
<command id="cmd_close" oncommand="BrowserCloseTabOrWindow()"/>
<command id="cmd_closeWindow" oncommand="BrowserTryToCloseWindow()"/>
<command id="cmd_CustomizeToolbars" oncommand="BrowserCustomizeToolbar()"/>
<command id="cmd_quitApplication" oncommand="goQuitApplication()"/>
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -1733,17 +1733,17 @@ function HandleAppCommandEvent(evt) {
case "Print":
PrintUtils.print(gBrowser.selectedBrowser.contentWindowAsCPOW,
gBrowser.selectedBrowser);
break;
case "Save":
saveDocument(gBrowser.selectedBrowser.contentDocumentAsCPOW);
break;
case "SendMail":
- MailIntegration.sendLinkForWindow(window.content);
+ MailIntegration.sendLinkForBrowser(gBrowser.selectedBrowser);
break;
default:
return;
}
evt.stopPropagation();
evt.preventDefault();
}
@@ -6519,19 +6519,18 @@ function warnAboutClosingWindow() {
// closing multiple tabs.
return isPBWindow || gBrowser.warnAboutClosingTabs(gBrowser.closingTabsEnum.ALL);
#else
return true;
#endif
}
var MailIntegration = {
- sendLinkForWindow: function (aWindow) {
- this.sendMessage(aWindow.location.href,
- aWindow.document.title);
+ sendLinkForBrowser: function (aBrowser) {
+ this.sendMessage(aBrowser.currentURI.spec, aBrowser.contentTitle);
},
sendMessage: function (aBody, aSubject) {
// generate a mailto url based on the url and the url's title
var mailtoUrl = "mailto:";
if (aBody) {
mailtoUrl += "?body=" + encodeURIComponent(aBody);
mailtoUrl += "&subject=" + encodeURIComponent(aSubject);
--- a/browser/components/customizableui/CustomizableWidgets.jsm
+++ b/browser/components/customizableui/CustomizableWidgets.jsm
@@ -915,17 +915,17 @@ const CustomizableWidgets = [
this.charsetInfo = CharsetMenu.getData();
}
}
}, {
id: "email-link-button",
tooltiptext: "email-link-button.tooltiptext3",
onCommand: function(aEvent) {
let win = aEvent.view;
- win.MailIntegration.sendLinkForWindow(win.content);
+ win.MailIntegration.sendLinkForBrowser(win.gBrowser.selectedBrowser)
}
}, {
id: "loop-button",
type: "custom",
label: "loop-call-button3.label",
tooltiptext: "loop-call-button3.tooltiptext",
defaultArea: CustomizableUI.AREA_NAVBAR,
introducedInVersion: 4,