Hi, we are developing an app which runs in the browser and as an electron app. There's been a release that has introduced this code:
if (typeof module !== 'undefined' && module.require) {
// node.js - disable worker and set require.ensure.
PDFJS.disableWorker = true;
...
The problem is that module.require exists in electron too, so web workers are disabled even if they should not. I patched pdf.js this way:
if (typeof window === 'undefined' && typeof module !== 'undefined' && module.require) {
// node.js - disable worker and set require.ensure.
PDFJS.disableWorker = true;
...
and it seems to work. I think this patch should not cause other unwanted troubles, so could it be possibile to add it to pdf.js?
Hi, we are developing an app which runs in the browser and as an electron app. There's been a release that has introduced this code:
The problem is that
module.requireexists in electron too, so web workers are disabled even if they should not. I patched pdf.js this way:and it seems to work. I think this patch should not cause other unwanted troubles, so could it be possibile to add it to pdf.js?