PDF.JS
Posted by: Mark Blain
Date: September 19, 2016 12:04AM

As a test, I downloaded PDF.JS.

https://mozilla.github.io/pdf.js/

I opened viewer.html with K-Meleon and used it to open and view several local PDF files. It worked flawlessly.

Has here been any interest in providing built-in support for PDF.JS in K-Meleon?

Re: PDF.JS
Posted by: JamesD
Date: September 19, 2016 01:06PM

Mark

Your post is the first I have heard of PDF.JS. I have downloaded the stuff and can open viewer.html in K-Meleon. I have not been able to figure out how to change the pdf file to a local one.

Any idea on how to use this such that the file to which one links in the browser is shown?

I rarely show PDF files in the browser and I have adapted an old dll from SumatraPDF for my purpose. I don't think the current version of Sumatra includes the file.

Re: PDF.JS
Posted by: JohnHell
Date: September 19, 2016 06:11PM

Quote
JamesD
Mark

Your post is the first I have heard of PDF.JS. I have downloaded the stuff and can open viewer.html in K-Meleon. I have not been able to figure out how to change the pdf file to a local one.

Any idea on how to use this such that the file to which one links in the browser is shown?

I rarely show PDF files in the browser and I have adapted an old dll from SumatraPDF for my purpose. I don't think the current version of Sumatra includes the file.


From the page above:
Quote

Trying the Viewer

With the prebuilt or source version open web/viewer.html in a browser and the test pdf should load. Note: the worker is not enabled for file:// urls, so use a server. If you’re using the source build and have node, you can run gulp server.


I never liked to view PDFs inside the browser either :/ and, even is a good request, I don't find the need to ship this as built-in or in the package of K-meleon, as it is enough to run viewer.html to view PDFs and it is better to download the latest versions, instead the one shipped with K-meleon.

It just needs a macro to call viewer.html and pass the url of that PDF as a parameter, as the documentation suggests:

viewer.html?file=compressed.tracemonkey-pldi-09.pdf

Re: PDF.JS
Posted by: Yogi
Date: September 19, 2016 06:24PM

@Mark Blain

K-Meleon's code is based on that of Firefox ESR.
Newest Firefox ESR have pdf.js built in. Hence a future version of K-Meleon will probably have it built in as well.
As handy as it might look at first glance, keep in mind that this feature might pose security and privacy risks.
IMHO, best practice is to disable this feature in browsers and open PDF-files with a dedicated viewer which allows you to disable scripting in PDF-files.
JavaScript in PDF documents can do nasty things, you won't even notice. While security related issues might become fixed as they were in the past, privacy related issues won't, because they aren't even considered issues. E.g. how about a ping sent by your browser to a server, as often as you open a specially crafted PDF?

Re: PDF.JS
Posted by: Mark Blain
Date: September 19, 2016 11:11PM

Quote
JamesD
Mark

Your post is the first I have heard of PDF.JS. I have downloaded the stuff and can open viewer.html in K-Meleon. I have not been able to figure out how to change the pdf file to a local one.

Any idea on how to use this such that the file to which one links in the browser is shown?

I rarely show PDF files in the browser and I have adapted an old dll from SumatraPDF for my purpose. I don't think the current version of Sumatra includes the file.

For testing, I've just been using the "Open File" button in the built-in toolbar after loading viewer.html.

Re: PDF.JS
Posted by: Mark Blain
Date: September 19, 2016 11:19PM

Quote
Yogi
@Mark Blain

K-Meleon's code is based on that of Firefox ESR.
Newest Firefox ESR have pdf.js built in. Hence a future version of K-Meleon will probably have it built in as well.
As handy as it might look at first glance, keep in mind that this feature might pose security and privacy risks.
IMHO, best practice is to disable this feature in browsers and open PDF-files with a dedicated viewer which allows you to disable scripting in PDF-files.
JavaScript in PDF documents can do nasty things, you won't even notice. While security related issues might become fixed as they were in the past, privacy related issues won't, because they aren't even considered issues. E.g. how about a ping sent by your browser to a server, as often as you open a specially crafted PDF?

The idea of using the browser itself as a PDF viewer appeals to the minimalist in me, but I bow to your expertise on javascript risks.

K-Meleon forum is powered by Phorum.