-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues with patch that removed disableWorker
#9443
Comments
If what you're suggesting is to completely remove line Line 1336 in 6b7e2cb
then that would make it totally impossible, rather than the intended difficult, for users to disable workers. This would also imply that it's no longer possible to simulate the functionality of the (now removed) pdf.combined.js file, by manually loading pdf.worker.js into the main-thread.
Please note that, as part of the upcoming version
In that case, why don't you simply use Lines 141 to 144 in 6b7e2cb
|
Ah perfect, let me try Edit: Unfortunately it looks like SharedWorkers (for the exposed port) aren't supported in IE11, which we have to support for the foreseeable future. I'm going to look into using Do you foresee any issue with swapping the order of:
So if Line 64 in 6b7e2cb
|
That seems somewhat orthogonal to the rest of the issue, but I suppose that would be OK. |
Thanks for all the great work!
I'm running into a slight issue with my particular setup. The recent patch to remove
PDFJS.disableWorker
(56a8c93) updated one of the checks for a fake worker to useI prefetch the worker file while users are not on a page that requires PDF preview, and when they do come to a document preview, I point the workerSrc to that same file that I prefetched earlier. Because of browser caching, the worker can be loaded from the cache. With this patch,
getMainThreadWorkerMessageHandler()
will return a handler because I prefetched the worker file at an earlier time and then this block returns false and goes into_setupFakeWorker()
. Can this last handler check be entirely removed?On a related, but slightly different note, would you folks be open to a PR that swaps these two in
pdf.js/src/display/api.js
Line 1204 in 7fbeeeb
The library I build can sometimes be run in an application that uses RequireJS (in which
workerSrc
will be set to requirejs.url(...something)). I'd explicitly like to keep using the workerSrc I define using PDFJS.workerSrc = 'someUrl'.The text was updated successfully, but these errors were encountered: