Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Firefox 19 Beta Brings JavaScript-Based PDF Viewer

  1. #1
    Join Date
    Jan 2007
    Posts
    14,345

    Default Firefox 19 Beta Brings JavaScript-Based PDF Viewer

    Phoronix: Firefox 19 Beta Brings JavaScript-Based PDF Viewer

    For those not busy playing around with the Snowshoe web-browser, the beta of Mozilla Firefox 19.0 has been released and is ready for testing...

    http://www.phoronix.com/vr.php?view=MTI3Mjg

  2. #2
    Join Date
    Sep 2009
    Posts
    116

    Default

    I'm running the nightly Firefox build. I've actually had to turn the builtin PDF reader off. It's too slow.

  3. #3
    Join Date
    Jul 2008
    Location
    Greece
    Posts
    3,778

    Default

    Why don't they use a plugin, like Chrome does? (And it's very fast.) JavaScript is for web pages, not for the browser. Sounds kind of stupid what Mozilla is doing.

  4. #4
    Join Date
    Oct 2008
    Posts
    3,033

    Default

    Quote Originally Posted by RealNC View Post
    Why don't they use a plugin, like Chrome does? (And it's very fast.) JavaScript is for web pages, not for the browser. Sounds kind of stupid what Mozilla is doing.
    Originally I thought it was just supposed to be an experiment, to see what kinds of problems there were creating a complicated program to run in the browser. I'm not sure when they decided to actually make it the default.

    But the basic reasoning goes like this -

    1. The job of a web browser is to show documents (html,xml,etc.) so why does it pass off pdf documents to an external program? Let's just have the browser handle it natively.
    2. A pdf viewer written in javascript will increase security - it's a managed language, and the browser is already hardened against attacks that could come through js, while external viewers are often out of date and we can't know whether they are secure or not.
    3. Loading the pdf directly in the browser should be faster than launching an external program to do it. Better integrated/less likely to cause problems in the browser too.

    1 and 2 make some sense to me, even if there probably are other ways to attack these issues as well. I don't think they're quite there on #3 yet, though.

    Edit: https://people.mozilla.com/~cjones/P...japan-2012.pdf
    Last edited by smitty3268; 01-11-2013 at 09:02 PM.

  5. #5
    Join Date
    Sep 2009
    Posts
    116

    Default

    Quote Originally Posted by smitty3268 View Post
    Originally I thought it was just supposed to be an experiment, to see what kinds of problems there were creating a complicated program to run in the browser. I'm not sure when they decided to actually make it the default.

    But the basic reasoning goes like this -

    1. The job of a web browser is to show documents (html,xml,etc.) so why does it pass off pdf documents to an external program? Let's just have the browser handle it natively.
    2. A pdf viewer written in javascript will increase security - it's a managed language, and the browser is already hardened against attacks that could come through js, while external viewers are often out of date and we can't know whether they are secure or not.
    3. Loading the pdf directly in the browser should be faster than launching an external program to do it. Better integrated/less likely to cause problems in the browser too.
    All three of these arguments make good sense to me. Also, JS isn't really that slow these days; we're stuck with it as a standard, so huge amounts of engineering effort have gone into making it fast. I don't think the idea of a built-in JS PDF viewer is a defective one, and it could be made to perform well. It just isn't finished yet, IMO.

  6. #6
    Join Date
    Feb 2012
    Posts
    70

    Default

    Its far from finished. Load a big enough PDF file, (4-5MB) and the whole browser will freeze till the PDF is completely rendered.
    Even after loading is complete, the scrolling, panning and zooming is ridiculously slow, specially on older hardware.
    A pdf plugin renders the same pdf quite easily.

  7. #7
    Join Date
    Jul 2008
    Location
    Greece
    Posts
    3,778

    Default

    Quote Originally Posted by smitty3268 View Post
    Originally I thought it was just supposed to be an experiment, to see what kinds of problems there were creating a complicated program to run in the browser. I'm not sure when they decided to actually make it the default.

    But the basic reasoning goes like this -

    1. The job of a web browser is to show documents (html,xml,etc.) so why does it pass off pdf documents to an external program? Let's just have the browser handle it natively.
    2. A pdf viewer written in javascript will increase security - it's a managed language, and the browser is already hardened against attacks that could come through js, while external viewers are often out of date and we can't know whether they are secure or not.
    3. Loading the pdf directly in the browser should be faster than launching an external program to do it. Better integrated/less likely to cause problems in the browser too.

    1 and 2 make some sense to me, even if there probably are other ways to attack these issues as well. I don't think they're quite there on #3 yet, though.

    Edit: https://people.mozilla.com/~cjones/P...japan-2012.pdf
    A plugin is not an external program. Chrome bundles a plugin for PDF viewing that doesn't open any external program. I believe it's a PPAPI plugin (just like their Flash plugin) so it should be sandboxed.

  8. #8
    Join Date
    Jan 2011
    Posts
    154

    Default

    Quote Originally Posted by mayankleoboy1 View Post
    Its far from finished. Load a big enough PDF file, (4-5MB) and the whole browser will freeze till the PDF is completely rendered.
    Even after loading is complete, the scrolling, panning and zooming is ridiculously slow, specially on older hardware.
    A pdf plugin renders the same pdf quite easily.
    If you look at the HTML it generates you'll see why it's slow. Some PDFs will produce sub-par markup, and others are just horrendous. I just took a look at the Android 4.2 Compatibility Definition Document and every character (even whitespace) is a separate DIV with CSS transformations. Each page takes around 2 seconds to render and it's just text.

    What annoys me about how it is configured is that it will only load pages as you scroll them into view. I'd rather it continue to load the whole document asynchronously.
    Last edited by randomizer; 01-12-2013 at 12:53 AM.

  9. #9
    Join Date
    Jan 2008
    Posts
    206

    Default

    Quote Originally Posted by smitty3268 View Post
    1. The job of a web browser is to show documents (html,xml,etc.) so why does it pass off pdf documents to an external program? Let's just have the browser handle it natively.
    The problem is, the pdf isn't loaded "natively". The javascript does a pdf->html conversion. So for my understanding, it is implemented at the wrong level.

    3. Loading the pdf directly in the browser should be faster than launching an external program to do it. Better integrated/less likely to cause problems in the browser too.
    Well, the problem could be solved by offloading pdf-rendering to a library like poppler. It is already there, open-source and really fast-

    2. A pdf viewer written in javascript will increase security - it's a managed language, and the browser is already hardened against attacks that could come through js, while external viewers are often out of date and we can't know whether they are secure or not.
    Agreed =)

  10. #10
    Join Date
    Jan 2012
    Posts
    43

    Default Oh, no, not again

    Every time Adobe Reader installs itself on a machine, it stuffs a plugin into each and every browser it can find. So, I have to go in and turn that off. I've been doing this for over a decade and I'm tired of it. Please tell me that it will be possible to turn this off and let .pdf files be downloaded instead.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •