Open rstorm861 opened 2 years ago
If don't use stealth, it works fine https://github.com/rstorm861/puppeteer_test
index.html
<!DOCTYPE html> <html> <head> <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" /> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" /> <meta charset="utf-8" /> <title>test</title> </head> <body> <button onclick="onTest();">test</button> </body> <script> const ipcRenderer = window.api; function onTest() { ipcRenderer.send("test"); } </script> </html>
main.js
const { app, dialog, BrowserWindow } = require("electron"); const path = require("path"); const ipcMain = require("electron").ipcMain; ipcMain.on("test", function (event, ...arg) { test(); }); const puppeteer = require("puppeteer-extra"); const StealthPlugin = require("puppeteer-extra-plugin-stealth"); puppeteer.use(StealthPlugin()); async function test() { puppeteer.launch({ headless: false, executablePath: chromepath }).then(async (browser) => { const page = await browser.newPage(); await page.setViewport({ width: 800, height: 600 }); await page.goto("https://bot.sannysoft.com"); await browser.close(); }); }
package.json
{ "name": "test", "version": "1.0.0", "description": "", "main": "main.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start": "electron ." }, "author": "", "license": "ISC", "devDependencies": { "electron": "^17.0.0" }, "dependencies": { "chrome-paths": "^1.0.1", "puppeteer-extra": "^3.2.3", "puppeteer-extra-plugin-stealth": "^2.9.0" } }
I'm having the same issue.
@berstend mentioned on discord to use addExtra if you want to run multiple instances
Might be connected to #656
If don't use stealth, it works fine https://github.com/rstorm861/puppeteer_test
index.html
main.js
package.json