Don't use window.print in the Firefox builtin viewer (bug 1774427)

Currently, it's impossible to print a pdf in a sandboxed iframe in using window.print.
This commit is contained in:
Calixte Denizet 2022-09-19 14:22:32 +02:00
parent 2642573702
commit 620f1ef1a9
2 changed files with 9 additions and 1 deletions

View File

@ -152,6 +152,10 @@ class DefaultExternalServices {
static reportTelemetry(data) {}
static print() {
window.print();
}
static createDownloadManager(options) {
throw new Error("Not implemented: createDownloadManager");
}
@ -1897,7 +1901,7 @@ const PDFViewerApplication = {
if (!this.supportsPrinting) {
return;
}
window.print();
this.externalServices.print();
},
bindEvents() {

View File

@ -402,6 +402,10 @@ class FirefoxExternalServices extends DefaultExternalServices {
FirefoxCom.request("updateEditorStates", data);
}
static print() {
FirefoxCom.request("print", null);
}
static createL10n(options) {
const mozL10n = document.mozL10n;
// TODO refactor mozL10n.setExternalLocalizerServices