From 094faf4fd31981b8a8848ccb129a6c16f7056088 Mon Sep 17 00:00:00 2001 From: Christian Willms Date: Mon, 17 Mar 2025 13:56:07 +0100 Subject: [PATCH] introduce env variable disabling firefox addon installation --- packages/server/lib/browsers/firefox.ts | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/packages/server/lib/browsers/firefox.ts b/packages/server/lib/browsers/firefox.ts index abc57a9bbf76..4337ad3a250a 100644 --- a/packages/server/lib/browsers/firefox.ts +++ b/packages/server/lib/browsers/firefox.ts @@ -771,15 +771,20 @@ export async function open (browser: Browser, url: string, options: BrowserLaunc process.env.CYPRESS_REMOTE_DEBUGGING_PORT = cdpPort.toString() } - // install the browser extensions - await Promise.all(_.map(launchOptions.extensions, async (path) => { - debug(`installing extension at path: ${path}`) - const id = await webdriverClient.installAddOn(path, true) + // Check if extension installation is enabled + const shouldInstallExtensions = process.env.CYPRESS_FIREFOX_EXTENSION_INSTALL !== 'false' - debug(`extension with id ${id} installed!`) + if (shouldInstallExtensions) { + // Install the browser extensions + await Promise.all(_.map(launchOptions.extensions, async (path) => { + debug(`installing extension at path: ${path}`) + const id = await webdriverClient.installAddOn(path, true) - return - })) + debug(`extension with id ${id} installed!`) + })) + } else { + debug('Skipping Firefox extension installation due to CYPRESS_FIREFOX_EXTENSION_INSTALL=false') + } debug('setting up firefox utils') const client = await firefoxUtil.setup({ automation, url, webdriverClient, remotePort: cdpPort, useWebDriverBiDi: USE_WEBDRIVER_BIDI, onError: options.onError })