pdf forced to save instead of display: site fault or PM fault ?

Users and developers helping users with generic and technical Pale Moon issues on all operating systems.

Moderator: trava90

Forum rules
This board is for technical/general usage questions and troubleshooting for the Pale Moon browser only.
Technical issues and questions not related to the Pale Moon browser should be posted in other boards!
Please keep off-topic and general discussion out of this board, thank you!
Lucio Chiappetti
Astronaut
Astronaut
Posts: 660
Joined: 2014-09-01, 15:11
Location: Milan Italy

pdf forced to save instead of display: site fault or PM fault ?

Unread post by Lucio Chiappetti » 2016-04-13, 12:41

I have set my browser (PM 25.6.0 on Suse Linux) to invoke acrobat to display pdf. Usually I get a prompt popup which allows me to choose whether to view the file in acrobat (default) or save it to disk. Occasionally (seldom) however I get cases like this

If I go to this link http://www.atb.bergamo.it/user/Default. ... &COD=fun.c and click on "Orario invernale ..." I get this prompt popup
prompt.png
which is preset to Save. If I change it to Open with, I get this other popup
popup.png
.

Is this a "fault" of the originating site, of palemoon, or of my configuration ? and if so how should I modify my about:config ?
The reasonable man adapts himself to the world: the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. (G.B. Shaw)

User avatar
biopsin
Fanatic
Fanatic
Posts: 122
Joined: 2016-02-07, 17:15

Re: pdf forced to save instead of display: site fault or PM fault ?

Unread post by biopsin » 2016-04-13, 14:38

Do you have 2 "PDF document" entries in preferences -> applications list ?
(application/pdf) and (application/x-unknown) if not check in about:config if pdfjs.disabled = true
then associate the (application/x-unknown) to adobe, and it should either manage to view and/or save.
voidlinux_x64 glibc-2.78 / selfcompiled latest Palemoon (gcc-13.2.0) / GTK2

Lucio Chiappetti
Astronaut
Astronaut
Posts: 660
Joined: 2014-09-01, 15:11
Location: Milan Italy

Re: pdf forced to save instead of display: site fault or PM fault ?

Unread post by Lucio Chiappetti » 2016-04-13, 15:13

biopsin wrote:Do you have 2 "PDF document" entries in preferences -> applications list ?
(application/pdf) and (application/x-unknown) if not check in about:config if pdfjs.disabled = true
pdfjs.disabled is true, and I have three preferences for "Adobe Acrobat Document" : (application/pdf) (application/save) and (application/force-download).
I do not know where they come from (I never liked the way recent mozilla based browsers handle these things ... I'd very much prefer the mailcap and mime.type way (1)).
They are all set to Always Ask.

which is fine, I want to be prompted whether to view or to save (which I am), but I'd like to be able to choose in all cases (which in the offending case I cannot).
I suppose in the offending case the originating site is declaring something which is not application/pdf

(1) with mailcap and mime.type I am able for instance in alpine to force acrobat to deal with pdf mail attachments which are incorrectly set to a different type then application/pdf according to the file extension
The reasonable man adapts himself to the world: the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. (G.B. Shaw)

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35635
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: pdf forced to save instead of display: site fault or PM fault ?

Unread post by Moonchild » 2016-04-13, 16:01

If Pale Moon doesn't give you the option to open it in the viewer, then the server is indeed supplying a MIME type for the content that isn't a PDF document.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
Pallid Planetoid
Knows the dark side
Knows the dark side
Posts: 4279
Joined: 2015-10-06, 16:59
Location: Los Angeles CA USA

Re: pdf forced to save instead of display: site fault or PM fault ?

Unread post by Pallid Planetoid » 2016-04-13, 16:25

Moonchild wrote:If Pale Moon doesn't give you the option to open it in the viewer, then the server is indeed supplying a MIME type for the content that isn't a PDF document.
Does this rule apply to all Pale Moon builds post 26 as well? (so presumably if it is a proper PDF document then Pale Moon will provide the option to open in viewer)
Current Pale Moon(x86) Release | WIN10 | I5 CPU, 1.7 GHz, 6GB RAM, 500GB HD[20GB SSD]
Formerly user Pale Moon Rising - to provide context involving embedded reply threads.
Good judgment comes from experience and a lot of that comes from bad judgment. - Will Rogers
Knowing Pale Moon is indisputably #1 is defined by knowing the totality of browsers. - Pale Moon Rising

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35635
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: pdf forced to save instead of display: site fault or PM fault ?

Unread post by Moonchild » 2016-04-13, 19:50

This rule applies to all versions of Pale Moon.

If a server specifically tells us that it's sending a certain data type, then that always takes precedence over whatever type would be guessed based on file extension. That's just following the HTML standard.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Lucio Chiappetti
Astronaut
Astronaut
Posts: 660
Joined: 2014-09-01, 15:11
Location: Milan Italy

Re: pdf forced to save instead of display: site fault or PM fault ?

Unread post by Lucio Chiappetti » 2016-04-14, 08:30

Moonchild wrote:If Pale Moon doesn't give you the option to open it in the viewer, then the server is indeed supplying a MIME type for the content that isn't a PDF document.
Yes but ... two questions, a specific and a general one.

The specific is that (see the popup screen dump above) Pale Moon (1) recognises it as an Adobe Acrobat Document, but (2) sets it as default to save, (3) does not disable the view radio button, (4) gives an error when trying to view. This makes me think the server is doing something odd. Do you confirm ? Is there some debugging hook in Pale Moon which allows me to understand what they are doing ?

The general one concerns the way a server and a browser negotiate a MIME type (please feel free to redirect me to tutorial on the net). I know how this occurs in e-mail, I wrote some personal filters to get rid of some attachments, and also I know that some sites send mail with the wrong MIME type, often exactly concerning PDF file. For instance our secretary's PC seem to think PDF are some sort of video and that confuses a script we use to process job announcements for our web site. Or I know an hospital who sends the therapy for my mother in PDF but tagged as Application/OCTET-STREAM. As I said, by judicious editing of .mailcap and mime.types I managed to instruct my MUA (Alpine) to recognise the attachment as a PDF (that exploits some "safe" hook built in Alpine, so when I click on it, Alpine prompts me for a permission "Try open by file extension ?". This is a safeguard against file disguised under a false mime type or extension. I have to explicitly trust the sender.
Given that sites/servers can do something wrong/odd is there a similar corrective action which can be taken at browser level (Pale Moon or extension) ?
The reasonable man adapts himself to the world: the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. (G.B. Shaw)

Fedor2

Re: pdf forced to save instead of display: site fault or PM fault ?

Unread post by Fedor2 » 2016-04-14, 11:22

Lucio Chiappetti wrote:pdfjs.disabled is true
Is it not obvious, how it to do work if it was disabled? Enable it and restart the browser.

Lucio Chiappetti
Astronaut
Astronaut
Posts: 660
Joined: 2014-09-01, 15:11
Location: Milan Italy

Re: pdf forced to save instead of display: site fault or PM fault ?

Unread post by Lucio Chiappetti » 2016-04-14, 15:03

What is the purpose of this "pdfjs.disabled" ? true is the default (factory?) value, and I never changed it.
I am able to process most pdf files (99% except some odd cases) exactly as I wish, i.e. view or save them with an external viewer.
The reasonable man adapts himself to the world: the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. (G.B. Shaw)

Locked