 <p>To solve this, I had to add</p> <pre><code>PDFJS.disableWorker = true; </code></pre> <p>to the beginning of my <code>loadPage</code> function.</p> <p>From <a href="http://codingcrazy87.blogspot.com/2014/05/view-pdf-files-directly-within-browser.html" rel="nofollow">View PDF files directly within browser using PDF.js</a>,</p> <blockquote> <p>PDF.js uses Web Workers concept of HTML5 internally to process the request. If this statement is set to false, it creates an instance of Web workers. Web Workers run in an isolated thread. For more information on web workers; please refer <a href="http://www.html5rocks.com/en/tutorials/workers/basics/" rel="nofollow">http://www.html5rocks.com/en/tutorials/workers/basics/</a></p> </blockquote>