From 25021a0b235311c91bbac3bc3d3ff0b6b2aa8f0d Mon Sep 17 00:00:00 2001 From: Anthony Ye Date: Mon, 30 Sep 2024 10:40:51 +0800 Subject: [PATCH] support chrome download activity access under headless mode (enable for --headless=new) --- packages/plugin-selenium-driver/src/plugin/index.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/packages/plugin-selenium-driver/src/plugin/index.ts b/packages/plugin-selenium-driver/src/plugin/index.ts index 60ff9b21..6b9e7213 100644 --- a/packages/plugin-selenium-driver/src/plugin/index.ts +++ b/packages/plugin-selenium-driver/src/plugin/index.ts @@ -187,14 +187,8 @@ export class SeleniumPlugin implements IBrowserProxyPlugin { } const googleChromeOptions = mergedConfig.capabilities?.['goog:chromeOptions']; - if ( - googleChromeOptions && - ( - googleChromeOptions.args?.includes('--headless') || - googleChromeOptions.args?.includes('headless') - ) - ) { - const extensions = mergedConfig.capabilities?.['goog:chromeOptions'].extensions; + if (googleChromeOptions?.args?.includes('--headless=new')) { + const extensions = googleChromeOptions.extensions; const dowldMonitorCrx = getCrxBase64(); if (extensions) { extensions.push(dowldMonitorCrx);