The PDF viewer is built entirely with JavaScript, HTML and CSS

Jun 9, 2012 12:21 GMT  ·  By

With Firefox 13 in the stable channel and Firefox 14 in beta, it was Firefox 15's turn to make the jump. Aurora users are now getting updated to the latest version of the browser that has spent the last six weeks in active development in the Nightly channel.

Firefox 15 is already shaping up to be quite an interesting release. A big new feature, and an interesting one is the built-in PDF viewer.

Several people at Mozilla have been working on the feature for close to a year now and it is almost ready. It is bundled with Firefox 15 Aurora and enabled by default.

The PDF viewer has recently gotten an UI refresh and looks rather spiffy. It works fairly good as well, though it may not be able to display every detail in every PDF file. It should cover the vast majority of common use cases though.

It's fairly fast as well, scrolling is snappy and so is content loading. That's either to be expected or a complete surprise depending on how you look at it.

The really interesting part about the PDF viewer in Firefox is that it's built entirely in JavaScript, so, to display a PDF document, the browser only needs to do what it does very well already, parse JavaScript and render a page via HTML and CSS.

The "surprise" being that something built on JavaScript can be as fast if not faster than a plugin running native code.

Having a built-in PDF viewer, especially one that is built with standard web technologies, is a great advantage. It means users don't have to install resource hungry and insecure plugins.

This not only means the browser is faster, there are no risks of getting infected via a malicious PDF file as well. Alternatively, it means they don't have to run or even install a new app just to view a file.

One great side effect of the PDF viewer in Firefox, dubbed PDF.js is that it's open source. And, since it's just JavaScript code, any webpage can build an embedded viewer based on the project.

Alternatively, other browsers or any other app can use the code to add support for PDF files. It's already available as a Firefox add-on, so it obviously can be ported rather easily. In fact, if you want to try it out without switching to Firefox 15, all you have to do is get the add-on.