Bug 1697836 - Improve error handling when failing to window.print(). r=emalysz

Ensure we report the error to the web console, and that the print
browser gets removed, as that is what will exit the modal state in the
page that's printing.

Differential Revision: https://phabricator.services.mozilla.com/D109714
This commit is contained in:
Emilio Cobos Álvarez 2021-03-27 10:22:54 +00:00
Родитель a6b034109b
Коммит 188f91724f
1 изменённых файлов: 6 добавлений и 1 удалений

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

@ -338,7 +338,12 @@ var PrintUtils = {
printInitiationTime,
printSelectionOnly,
printFrameOnly
).catch(() => {});
).catch(e => {
Cu.reportError(e);
if (browser) {
browser.remove();
}
});
return browser;
}