Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Disabling Automated Firefox Extension Installation via Cypress Env Variable #31316

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions packages/server/lib/browsers/firefox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
Expand Down
Loading