Initialize the electron app to accept puppeteer/DevTools connections. Must be called at startup before the electron app is ready.
app
App The app imported from electron.port
number Port to host the DevTools websocket connection. (optional, default0
)
Connects puppeteer to the electron app. Must call initialize before connecting. When connecting multiple times, you use the same port.
app
App The app imported from electron.puppeteer
puppeteer The imported puppeteer namespace.
Returns Promise<Browser> An object containing the puppeteer browser, the port, and json received from DevTools.
Given a BrowserWindow, find the corresponding puppeteer Page. It is undefined if external operations occur on the page whilst we are attempting to find it. A url/file must be loaded on the window for it to be found. If no url is loaded, the parameter 'allowBlankNavigate' allows us to load "about:blank" first.
browser
Browser The puppeteer browser instance obtained from calling |connect|.window
BrowserWindow The browser window for which we want to find the corresponding puppeteer Page.allowBlankNavigate
boolean If no url is loaded, allow us to load "about:blank" so that we may find the Page. (optional, defaulttrue
)
Returns Promise<Page> The page that corresponds with the BrowserWindow.