ulixee / secret-agent

The web scraper that's nearly impossible to block - now called @ulixee/hero
https://secretagent.dev
MIT License
670 stars 44 forks source link

How to prevent chrome.exe opening #296

Closed akavenus closed 3 years ago

akavenus commented 3 years ago

Is there anyway to prevent this blank command line from opening while using secret agent?

image

blakebyrnes commented 3 years ago

@akavenus does that show up if you run headless? Or just when headed?

nlile commented 3 years ago

@blakebyrnes I'm also getting (multiple) blank command lines in both headed & headless.

akavenus commented 3 years ago

For me it happens on both

Full code const { Agent } = require('secret-agent') async function start(){ process.env.SA_SHOW_BROWSER = 'true'; process.env.SA_DISABLE_DEVTOOLS=1 const agent = await new Agent({ viewport: { width: 400, height: 800, screenWidth: 500, screenHeight: 900 } }); await agent.goto('https://www.target.com/bia'); } start() module.exports.start = start

A-Posthuman commented 3 years ago

Just chiming in to say I also see the empty black command window labeled chrome popping up on Windows.

blakebyrnes commented 3 years ago

@akavenus @A-Posthuman @nlile I'm assuming no one sees this using puppeteer or playwright?

akavenus commented 3 years ago

Yes, I do not see this on puppeter. As for playwright I can't comment as I dont use that

nlile commented 3 years ago

Yes, I do not see this on puppeter. As for playwright I can't comment as I dont use that

Gotcha covered, I don't see this on playwright, haven't tried puppeteer.

blakebyrnes commented 3 years ago

This is being triggered by the "--enable-logging" Chromium launch argument. Will fix, but in interim, you can filter out using a plugin that overrides onBrowserWillLaunch and removes this argument. (https://secretagent.dev/docs/plugins/core-plugins)