Skip to content

Commit

Permalink
Update webpack.js to support browsers that do not have the Web Worker…
Browse files Browse the repository at this point in the history
…s API
  • Loading branch information
FranckFreiburger committed May 26, 2017
1 parent 8d55e6a commit a0b7f84
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion external/dist/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@

var pdfjs = require('./build/pdf.js');
var PdfjsWorker = require('worker-loader!./build/pdf.worker.js');
pdfjs.PDFJS.workerPort = new PdfjsWorker();

if (typeof window !== 'undefined' && 'Worker' in window) {
pdfjs.PDFJS.workerPort = new PdfjsWorker();
} else {
pdfjs.PDFJS.disableWorker = true;
}

module.exports = pdfjs;

0 comments on commit a0b7f84

Please sign in to comment.