Search code examples
javascriptnode.jspuppeteerwebautomationbrave

Can't use Brave Browser with Puppeteer


About a month ago I wrote a question asking if it were possible using Brave Browser with puppeteer; the answer was yes, I tested it, and everything worked perfectly; today I tried to run the same code but i got the error ERROR: process "xxxxx" not found

Any ideas about this issue?

const puppeteer = require('puppeteer');

(async()=>{
        const browser = await puppeteer.launch({
            executablePath:"C:/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",
            headless:false,
            devtools:false,
        })
        const page = await browser.newPage()
})()

Solution

  • You need to do at least two things to get puppeteer working with Brave.

    First, you need to enable remote debugging on brave. You need to go to chrome://settings/privacy and then enable Remote debugging.

    enter image description here

    Second, Brave doesn't like many default command-line arguments that puppeteer sends. So you might want to ignore default arguments.

    (async()=>{
        const browser = await puppeteer.launch({
            executablePath:"/Applications/Brave Browser.app/Contents/MacOS/Brave Browser",
            headless:false,
            ignoreDefaultArgs: true
        })
        const page = await browser.newPage()
        page.goto("https://www.google.com")
    })()