summaryrefslogtreecommitdiffstats
path: root/devtools/client/shared/screenshot.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
commita90a5cba08fdf6c0ceb95101c275108a152a3aed (patch)
tree532507288f3defd7f4dcf1af49698bcb76034855 /devtools/client/shared/screenshot.js
parentAdding debian version 126.0.1-1. (diff)
downloadfirefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.tar.xz
firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/client/shared/screenshot.js')
-rw-r--r--devtools/client/shared/screenshot.js14
1 files changed, 4 insertions, 10 deletions
diff --git a/devtools/client/shared/screenshot.js b/devtools/client/shared/screenshot.js
index ca746f66e7..4031708293 100644
--- a/devtools/client/shared/screenshot.js
+++ b/devtools/client/shared/screenshot.js
@@ -327,9 +327,9 @@ function saveToClipboard(base64URI) {
let _outputDirectory = null;
/**
- * Returns the default directory for screenshots.
- * If a specific directory for screenshots is not defined,
- * it falls back to the system downloads directory.
+ * Returns the default directory for DevTools screenshots.
+ * For consistency with the Firefox Screenshots feature, this will default to
+ * the preferred downloads directory.
*
* @return {Promise<String>} Resolves the path as a string
*/
@@ -338,13 +338,7 @@ async function getOutputDirectory() {
return _outputDirectory;
}
- try {
- // This will throw if there is not a screenshot directory set for the platform
- _outputDirectory = Services.dirsvc.get("Scrnshts", Ci.nsIFile).path;
- } catch (e) {
- _outputDirectory = await lazy.Downloads.getPreferredDownloadsDirectory();
- }
-
+ _outputDirectory = await lazy.Downloads.getPreferredDownloadsDirectory();
return _outputDirectory;
}