Bug 1633270 - don't default to saveToDisk if we are supposed to handle internally, r=jaws
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Sat, 16 May 2020 13:22:01 +0000
changeset 594381 13d87924353a58383c059b7ea6c0dfaea99e91f4
parent 594380 cc77f973fe41c443b5845041fdd389cabf16feea
child 594382 ba9302c4f9b41ce6b5e6c3e4a9ae3ee9ce911190
push id13186
push userffxbld-merge
push dateMon, 01 Jun 2020 09:52:46 +0000
treeherdermozilla-beta@3e7c70a1e4a1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws
bugs1633270
milestone78.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1633270 - don't default to saveToDisk if we are supposed to handle internally, r=jaws Differential Revision: https://phabricator.services.mozilla.com/D75581
uriloader/exthandler/nsExternalHelperAppService.cpp
--- a/uriloader/exthandler/nsExternalHelperAppService.cpp
+++ b/uriloader/exthandler/nsExternalHelperAppService.cpp
@@ -1680,16 +1680,23 @@ NS_IMETHODIMP nsExternalAppHandler::OnSt
 
   // OK, now check why we're here
   if (!alwaysAsk && mReason != nsIHelperAppLauncherDialog::REASON_CANTHANDLE) {
     // Force asking if we're not saving.  See comment back when we fetched the
     // alwaysAsk boolean for details.
     alwaysAsk = (action != nsIMIMEInfo::saveToDisk);
   }
 
+  // If we're not asking, check we actually know what to do:
+  if (!alwaysAsk) {
+    alwaysAsk = action != nsIMIMEInfo::saveToDisk &&
+                action != nsIMIMEInfo::useHelperApp &&
+                action != nsIMIMEInfo::useSystemDefault;
+  }
+
   // if we were told that we _must_ save to disk without asking, all the stuff
   // before this is irrelevant; override it
   if (mForceSave) {
     alwaysAsk = false;
     action = nsIMIMEInfo::saveToDisk;
   }
 
   if (alwaysAsk) {