berstend / puppeteer-extra

💯 Teach puppeteer new tricks through plugins.
https://extra.community
MIT License
6.48k stars 743 forks source link

[Bug] Error: Could not find expected browser (chrome) locally. Run `npm install` to download the correct Chromium revision (884014). #539

Open u10k opened 3 years ago

u10k commented 3 years ago

When my electron project is packaged, it is unavailable But is running in develop

import puppeteer from 'puppeteer-extra';
import StealthPlugin from 'puppeteer-extra-plugin-stealth';
browser = await puppeteer
            .use(StealthPlugin())
            .launch({});

System: OS: Windows 10 10.0.19041 CPU: (6) x64 Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz Memory: 3.95 GB / 15.87 GB Binaries: Node: 12.18.3 - C:\Program Files\nodejs\node.EXE npm: 6.14.6 - C:\Program Files\nodejs\npm.CMD npmPackages: puppeteer: ^10.1.0 => 10.1.0 puppeteer-extra: ^3.1.18 => 3.1.18 puppeteer-extra-plugin-stealth: ^2.7.8 => 2.7.8

u10k commented 3 years ago

image

kurohoan commented 3 years ago

I am also unable to use it on Electron as per the report below. Is there a solution?

https://github.com/berstend/puppeteer-extra/issues/540

u10k commented 3 years ago

I am also unable to use it on Electron as per the report below. Is there a solution?

540

I refer to the puppeteer-electron-quickstart but this example s electron version is 1.8.1, I got to electron=9.4.4 mainWindow.loadURL('http://localhost:8082/#/', {'extraHeaders': 'pragma: no-cache\n'}); `

this is puppeteer web,is not show ` platWindow = new BrowserWindow({show: false, width: 800, height: 600});

// and load the index.html of the app.
platWindow.loadURL(
    url.format({
        pathname: path.join(__dirname, 'index.html'),
        protocol: 'file:',
        slashes: true
    })
);

`