diff options
author | Moonchild <moonchild@palemoon.org> | 2020-12-15 11:33:29 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2020-12-15 13:39:34 +0000 |
commit | cd17592001225e2d988c3aca9bd700de3c8ce4a3 (patch) | |
tree | 4d462fe7a5f314369f373f6a42214bc9c0efbfcb | |
parent | 62d550e22d915e6fd440bb42be5445df51b06893 (diff) | |
download | UXP-cd17592001225e2d988c3aca9bd700de3c8ce4a3.tar UXP-cd17592001225e2d988c3aca9bd700de3c8ce4a3.tar.gz UXP-cd17592001225e2d988c3aca9bd700de3c8ce4a3.tar.lz UXP-cd17592001225e2d988c3aca9bd700de3c8ce4a3.tar.xz UXP-cd17592001225e2d988c3aca9bd700de3c8ce4a3.zip |
[toolkit] Handle corner case confusion of downloaded files without extension.
See code comment for details.
-rw-r--r-- | toolkit/components/jsdownloads/src/DownloadIntegration.jsm | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/toolkit/components/jsdownloads/src/DownloadIntegration.jsm b/toolkit/components/jsdownloads/src/DownloadIntegration.jsm index 7656128d2..ce525d4aa 100644 --- a/toolkit/components/jsdownloads/src/DownloadIntegration.jsm +++ b/toolkit/components/jsdownloads/src/DownloadIntegration.jsm @@ -718,6 +718,22 @@ this.DownloadIntegration = { return; } +#ifdef XP_WIN + // When a file has no extension, and there's an executable file with the + // same name in the same folder, the Windows shell can get confused. + // For this reason, we show the file in the containing folder instead of + // trying to open it. + // We also don't trust mimeinfo; it could be a type we can forward to a + // system handler, but it could also be an executable type, and we + // don't have an exhaustive list with all of them. + if (!fileExtension) { + // We can't check for the existence of a same-name file with every + // possible executable extension, so this is a catch-all. + this.showContainingDirectory(aDownload.target.path); + return; + } +#endif + // No custom application chosen, let's launch the file with the default // handler. First, let's try to launch it through the MIME service. if (mimeInfo) { |