mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Fix worker resolution on using minified version
- When the minified version is used the resolver of the worker can not find it properly and throws 404 error. - The problem was that: - It was getting the current name of the file. - It was replacing **.js** by **.worker.js** - When it was loading the unminified version it was working fine because: - *pdf.js - .js + .worker.js* = **pdf.worker.js** - When it was loading the minified version it didtn't work because: - *pdf.min.js - .js + .worker.js* = **pdf.min.worker.js** - **pdf.min.worker.js** doesn't exist the real file name is **pdf.worker.min.js**
This commit is contained in:
parent
d6dfc26d4e
commit
010d38a8c0
1 changed files with 1 additions and 1 deletions
|
@ -1097,7 +1097,7 @@ var PDFWorker = (function PDFWorkerClosure() {
|
|||
if (typeof PDFJSDev !== 'undefined' &&
|
||||
PDFJSDev.test('PRODUCTION && !(MOZCENTRAL || FIREFOX)') &&
|
||||
pdfjsFilePath) {
|
||||
return pdfjsFilePath.replace(/\.js$/i, '.worker.js');
|
||||
return pdfjsFilePath.replace(/(\.(?:min\.)?js)$/i, '.worker$1');
|
||||
}
|
||||
error('No PDFJS.workerSrc specified');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue