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
--- 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;
}