Reputation: 15099
I'm building an app using Atom Shell, and I'm trying to open an iframe which would load a PDF file, and then, once the PDF file is fully loaded, run some JS from the scope of that iframe (I'm willing to run Browser->Print (https://github.com/atom/atom-shell/blob/master/docs/api/browser-window.md#browserwindowprintoptions)
.
Is that possible? If so, how?
Upvotes: 0
Views: 524
Reputation: 406
Depends on where the PDF file is hosted, but usually the process goes like this:
.show()
the browser window.loadUrl(INSERT_PDF_URL)
into the browser windowwebContents
'did-finish-loading'
event, and then either run your JS if it is on the browser side, or .executeJavaScript(YOUR_JS_HERE)
if you need it to be run on the renderer side (within the browser window)Upvotes: 1