Open tushar-ghadge opened 2 years ago
I'm facing issue to load preload.js while using puppeteer-in-electron package
Here is the snippet:
const { BrowserWindow, app, protocol, BrowserView } = require("electron"); const pie = require("puppeteer-in-electron"); const puppeteer = require("puppeteer-core"); await pie.initialize(app); const createWindow = async () => { const browserConfig = { width: 1200, height: 900, webPreferences: { contextIsolation: true, nodeIntegration: true, enableRemoteModule: false, preload: path.join(__dirname, "preload.js"), // use a preload script }, }; const window = new BrowserWindow(browserConfig); const view = new BrowserView(); window.addBrowserView(view); const browser = await pie.connect(app, puppeteer); await pie.getPage(browser , view).goto(loginUrl); } app.on("ready", async () => { createWindow(); })
I'm facing issue to load preload.js while using puppeteer-in-electron package
Here is the snippet: