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

@ -511,6 +511,14 @@ HttpBaseChannel::SetContentCharset(const nsACString& aContentCharset)
NS_IMETHODIMP
HttpBaseChannel::GetContentDisposition(uint32_t *aContentDisposition)
{
// DISPOSITION_FORCE_INLINE is used to explicitly set inline, used by
// the pdf reader when loading an attachment pdf without downloading it.
if (mContentDispositionHint == nsIChannel::DISPOSITION_ATTACHMENT ||
mContentDispositionHint == nsIChannel::DISPOSITION_FORCE_INLINE) {
*aContentDisposition = mContentDispositionHint;
return NS_OK;
}
nsresult rv;
nsCString header;