This breaks the current implementation of electron-pdf because the ipcApi object that gets defined in the preload.js is not accessible from within the webpage's javascript itself. To handle the ready event, we inject a listener in exportJob.js#_executeJSListener that tries to use that object but fails because it is not defined in the page's context.
This can be solved in two ways:
Eplicitly disable contextIsolation when setting up the job in setupJob.js
Use the contextBridge api to expose ipcApi to the website's context.
As noted in the docs, the
contextIsolation
option is enabled by default from electron 12 on: https://www.electronjs.org/docs/tutorial/context-isolation#how-do-i-enable-itThis breaks the current implementation of
electron-pdf
because theipcApi
object that gets defined in thepreload.js
is not accessible from within the webpage's javascript itself. To handle the ready event, we inject a listener inexportJob.js#_executeJSListener
that tries to use that object but fails because it is not defined in the page's context.This can be solved in two ways:
contextIsolation
when setting up the job insetupJob.js
ipcApi
to the website's context.I will work on a PR that implements solution 2.