Page 1 of 1

Detect if PDF extension is active

Posted: Wed Mar 18, 2020 2:34 pm
by petko
Is there a way to see if the PDF extension is currently active in TChromium? I need to know when the user is browsing a PDF file in the PDF extension.

It there a direct way to do it or should I sniff the current URL address for a .pdf file extension?

Re: Detect if PDF extension is active

Posted: Wed Mar 18, 2020 2:58 pm
by salvadordf
Hi,

You can check the HTTP response headers to see if you received a Content-Type : application/pdf header or you can visit the DOM and search for an EMBED element with a type="application/pdf" attribute.