Bug 974771 - Ignore open request for unfinished download. r=wesj
authorEugen Sawin <esawin@mozilla.com>
Thu, 06 Mar 2014 22:19:17 +0100
changeset 191674 c64ce8e54e04a0b73712a7d1492bbea325e8a13b
parent 191673 187f55d9c2e589cf3a6993cc743ba06710ae655c
child 191675 720962c9f993403a96e9869e00ec11c422c7f7fa
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswesj
bugs974771
milestone30.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 974771 - Ignore open request for unfinished download. r=wesj
mobile/android/chrome/content/aboutDownloads.js
--- a/mobile/android/chrome/content/aboutDownloads.js
+++ b/mobile/android/chrome/content/aboutDownloads.js
@@ -453,16 +453,20 @@ let Downloads = {
     if (!aItem)
       return;
 
     aItem.parentNode.removeChild(aItem);
   },
 
   openDownload: function dl_openDownload(aItem) {
     this._getDownloadForElement(aItem, function(aDownload) {
+      if (aDownload.state !== Ci.nsIDownloadManager.DOWNLOAD_FINISHED) {
+        // Do not open unfinished downloads.
+        return;
+      }
       try {
         let f = aDownload.targetFile;
         if (f) f.launch();
       } catch (ex) {
         this.logError("openDownload() " + ex, aDownload);
       }
     }.bind(this));
   },