Enhance PDF handling by introducing DISPOSITION_FORCE_INLINE and updating content disposition logic

This commit is contained in:
ownedbywuigi 2026-03-31 11:46:59 +01:00
commit 257ddfa48d
6 changed files with 63 additions and 7 deletions

View file

@ -871,6 +871,11 @@ PdfStreamConverter.prototype = {
aRequest.setResponseHeader("Refresh", "", false);
}
// The document will be loaded via the stream converter as html, but we
// may have come here via a download/attachment path. Force inline so we
// don't get redirected back to the external helper service.
aRequest.contentDisposition = Ci.nsIChannel.DISPOSITION_FORCE_INLINE;
// Creating storage for PDF data
var contentLength = aRequest.contentLength;
this.dataListener = new PdfDataListener(contentLength);