Announcement

Collapse
No announcement yet.

Firefox 19 Beta Brings JavaScript-Based PDF Viewer

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

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

    Comment


    • #3
      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.

      Comment


      • #4
        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; 11 January 2013, 10:02 PM.

        Comment


        • #5
          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.

          Comment


          • #6
            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.

            Comment


            • #7
              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.

              Comment


              • #8
                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; 12 January 2013, 01:53 AM.

                Comment


                • #9
                  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 =)

                  Comment


                  • #10
                    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.

                    Comment

                    Working...
                    X