Bug 1391186 - Thunderbird loses setting as default email client when "mailto" triggered by Firefox 56/57 (OS X 10.11). r?baku draft
authorHaik Aftandilian <haftandilian@mozilla.com>
Mon, 28 Aug 2017 14:28:07 -0700
changeset 656937 04715a9387ab6bc839b5355532004ea8d8d283f4
parent 656312 f3444bb2040b8749aea9e47bd72fc99ba735cbdf
child 729295 51047a9628cc85d3992c26c9a6ecd072da332776
push id77382
push userhaftandilian@mozilla.com
push dateThu, 31 Aug 2017 21:55:12 +0000
reviewersbaku
bugs1391186
milestone57.0a1
Bug 1391186 - Thunderbird loses setting as default email client when "mailto" triggered by Firefox 56/57 (OS X 10.11). r?baku MozReview-Commit-ID: H0VVoHR7LmQ
uriloader/exthandler/mac/nsOSHelperAppService.mm
--- a/uriloader/exthandler/mac/nsOSHelperAppService.mm
+++ b/uriloader/exthandler/mac/nsOSHelperAppService.mm
@@ -1,16 +1,17 @@
 /* -*- Mode: C++; tab-width: 3; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include <sys/types.h>
 #include <sys/stat.h>
+#include "mozilla/net/NeckoCommon.h"
 #include "nsOSHelperAppService.h"
 #include "nsObjCExceptions.h"
 #include "nsISupports.h"
 #include "nsString.h"
 #include "nsTArray.h"
 #include "nsIURL.h"
 #include "nsIFile.h"
 #include "nsILocalFileMac.h"
@@ -555,16 +556,20 @@ nsOSHelperAppService::GetProtocolHandler
   NS_ADDREF(*_retval = handlerInfo);
 
   if (!*found) {
     // Code that calls this requires an object regardless if the OS has
     // something for us, so we return the empty object.
     return NS_OK;
   }
 
-  nsAutoString desc;
-  rv = GetApplicationDescription(aScheme, desc);
-  NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "GetApplicationDescription failed");
-  handlerInfo->SetDefaultDescription(desc);
+  // As a workaround for the OS X problem described in bug 1391186, don't
+  // attempt to get/set the application description from the child process.
+  if (!mozilla::net::IsNeckoChild()) {
+    nsAutoString desc;
+    rv = GetApplicationDescription(aScheme, desc);
+    NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "GetApplicationDescription failed");
+    handlerInfo->SetDefaultDescription(desc);
+  }
 
   return NS_OK;
 }