Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

Detect if PDF extension is active

Post Reply
petko
Posts: 52
Joined: Sun Jul 02, 2017 9:58 am

Detect if PDF extension is active

Post 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?
User avatar
salvadordf
Posts: 4052
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Detect if PDF extension is active

Post 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.
Post Reply