summaryrefslogtreecommitdiffstats
path: root/toolkit/content/contentAreaUtils.js
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-02-25 19:45:39 -0500
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-04-14 12:56:02 +0200
commitd20ca24a070d547be3bce4d513ef151b6be5f955 (patch)
treeb0b56d41c3f41db217e8f894c0545a0217dbba4f /toolkit/content/contentAreaUtils.js
parentb2ca17a29814f6aaf043240cd1ec2f86ca989419 (diff)
downloadUXP-d20ca24a070d547be3bce4d513ef151b6be5f955.tar
UXP-d20ca24a070d547be3bce4d513ef151b6be5f955.tar.gz
UXP-d20ca24a070d547be3bce4d513ef151b6be5f955.tar.lz
UXP-d20ca24a070d547be3bce4d513ef151b6be5f955.tar.xz
UXP-d20ca24a070d547be3bce4d513ef151b6be5f955.zip
Issue #1053 - Remove android support from toolkit
Note: Does not remove support completely from toolkit/mozapps/installer or from telemetry or AppConstants.jsm
Diffstat (limited to 'toolkit/content/contentAreaUtils.js')
-rw-r--r--toolkit/content/contentAreaUtils.js34
1 files changed, 1 insertions, 33 deletions
diff --git a/toolkit/content/contentAreaUtils.js b/toolkit/content/contentAreaUtils.js
index 2512804fa..17e463325 100644
--- a/toolkit/content/contentAreaUtils.js
+++ b/toolkit/content/contentAreaUtils.js
@@ -1115,40 +1115,8 @@ function validateFileName(aFileName)
aFileName = aFileName.replace(/[\<]+/g, "(");
aFileName = aFileName.replace(/[\>]+/g, ")");
}
- else if (navigator.appVersion.indexOf("Macintosh") != -1)
+ else if (navigator.appVersion.indexOf("Macintosh") != -1) {
re = /[\:\/]+/g;
- else if (navigator.appVersion.indexOf("Android") != -1) {
- // On mobile devices, the filesystem may be very limited in what
- // it considers valid characters. To avoid errors, we sanitize
- // conservatively.
- const dangerousChars = "*?<>|\":/\\[];,+=";
- var processed = "";
- for (var i = 0; i < aFileName.length; i++)
- processed += aFileName.charCodeAt(i) >= 32 &&
- !(dangerousChars.indexOf(aFileName[i]) >= 0) ? aFileName[i]
- : "_";
-
- // Last character should not be a space
- processed = processed.trim();
-
- // If a large part of the filename has been sanitized, then we
- // will use a default filename instead
- if (processed.replace(/_/g, "").length <= processed.length/2) {
- // We purposefully do not use a localized default filename,
- // which we could have done using
- // ContentAreaUtils.stringBundle.GetStringFromName("DefaultSaveFileName")
- // since it may contain invalid characters.
- var original = processed;
- processed = "download";
-
- // Preserve a suffix, if there is one
- if (original.indexOf(".") >= 0) {
- var suffix = original.split(".").slice(-1)[0];
- if (suffix && suffix.indexOf("_") < 0)
- processed += "." + suffix;
- }
- }
- return processed;
}
return aFileName.replace(re, "_");