Bug 1660013 - Include .pdf extension when saving as PDF on macOS and linux r=emalysz

Differential Revision: https://phabricator.services.mozilla.com/D87602
This commit is contained in:
Mark Striemer 2020-08-19 16:33:29 +00:00
Родитель 3bf91e4532
Коммит 5c558250f9
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -760,7 +760,9 @@ async function pickFileName(sourceBrowser, pageSettings) {
);
picker.appendFilter("PDF", "*.pdf");
picker.defaultExtension = "pdf";
picker.defaultString = filename;
// macOS and linux don't set the extension based on the default. Windows will
// only include the filename once, so we can add it there too.
picker.defaultString = filename + ".pdf";
let retval = await new Promise(resolve => picker.open(resolve));