---
id: api/cypress-api/isbrowser
title: Cypress.isBrowser | Cypress Documentation
description: Check if the current browser matches the given name or filter.
section: api
source_path: docs/api/cypress-api/isbrowser.mdx
version: 524ff5211e60b5d53e55d6ad976d83966f66e7cd
updated_at: '2026-04-30T14:20:05.396Z'
---
# Cypress.isBrowser

`Cypress.isBrowser` checks if the current browser matches the given name or filter.

## Syntax

```
Cypress.isBrowser(matcher)Cypress.isBrowser(matchers)Cypress.isBrowser(filter)
```

### Arguments

**matcher _(String)_**

The name of the browser (case-insensitive) you want to check against. Name can be prepended with a `!` character to inverse the check.

**matchers _(Array)_**

An array of the names of the browsers (case-insensitive) you want to check against. Name can be prepended with a `!` character to inverse the check.

**filter _(Object or Array)_**

Filter one or multiple browsers by the browser properties. You can inspect the current browser's properties by using the [Cypress.browser](/llm/markdown/api/cypress-api/browser.md). Supported properties are:

| Property | Type | Description |
| --- | --- | --- |
| `name` | `string` | Machine-friendly name, like `chrome`, `electron`, or `firefox`. |
| `family` | `string` | Rendering engine being used. `chromium` or `firefox`. |
| `channel` | `string` | Release channel of the browser, such as `stable`, `dev`, or `canary`. |
| `displayName` | `string` | Human-readable display name for the browser. |
| `version` | `string` | Full version. |
| `path` | `string` | Path to the browser on disk. Blank for Electron. |
| `majorVersion` | `number` | `string` | The major version number of the browser. |
| `isHeadless` | `boolean` | Whether the browser is running headlessly. |
| `isHeaded` | `boolean` | Whether the browser displays headed. |

## Examples

### Matcher

#### Only run command in Chrome

```
it('download extension link', () => {  // true when running in Firefox  if (Cypress.isBrowser('firefox')) {    cy.get('#dl-extension').should('contain', 'Download Firefox Extension')  }  // true when running in Chrome  if (Cypress.isBrowser('chrome')) {    cy.get('#dl-extension').should('contain', 'Download Chrome Extension')  }})
```

#### Run command in all browsers except Chrome

```
it('warns to view page in Chrome browser', () => {  // true when running in Firefox, etc...  if (Cypress.isBrowser('!chrome')) {    cy.get('.browser-warning').should(      'contain',      'For optimal viewing, use Chrome browser'    )  }})
```

### Matchers

#### Run commands in all specified browsers

```
it('colors rainbow', () => {  // true when running in Electron or Chrome  if (Cypress.isBrowser(['electron', 'chrome'])) {    cy.get('.rainbox').should(      'have.css',      'conic-gradient(red, orange, yellow, green, blue)'    )  }})
```

#### Run commands in all browsers except specified

```
// true when running in browser other than chrome and electronit('does not run in Firefox and Chrome', () => {  if (Cypress.isBrowser(['!electron', '!chrome'])) {    cy.get('#h4').should('have.css', 'font-size-adjust', '0.5')  }})
```

### Filter

#### Only run commands in Chromium-based browser

```
it('has CSS reflections', () => {  // if in Chromium-based browser (Chrome, Electron, etc...)  // check css property was properly applied  if (Cypress.isBrowser({ family: 'chromium' })) {    cy.get('.header').should('have.css', '-webkit-box-reflect', 'left')  }})
```

#### Only run on stable release in Chromium-based browser

```
it('test', () => {  // true when in any stable release of a Chromium-based browser  if (Cypress.isBrowser({ family: 'chromium', channel: 'stable' })) {    // test some (hypothetical) scenario in chrome stable  }})
```

#### Only run on specific release channels of browsers

```
it('test', () => {  // true when running in Chrome Canary  // and dev releases of Firefox browser  if (    Cypress.isBrowser([      { family: 'chromium', channel: 'canary' },      { family: 'firefox', channel: 'dev' },    ])  ) {    // test some (hypothetical) scenario  }})
```

### Notes

#### Test configuration: `browser`

If you want to target a test or suite to run or be excluded when run in a specific browser, we suggest passing the `browser` within the [test configuration](/llm/markdown/app/references/configuration.md#Test-Configuration). The `browser` option accepts the same [arguments](#Arguments) as `Cypress.isBrowser()`.

```
it('Download extension in Firefox', { browser: 'firefox' }, () => {  cy.get('#dl-extension').should('contain', 'Download Firefox Extension')})
```

```
it('Show warning outside Chrome', { browser: '!chrome' }, () => {  cy.get('.browser-warning').should(    'contain',    'For optimal viewing, use Chrome browser'  )})
```

## History

| Version | Changes |
| --- | --- |
| [4.8.0](/llm/markdown/app/references/changelog.md#4-8-0) | Expanded `matcher` and `matchers` arguments to assist in filtering browsers. |
| [4.0.0](/llm/markdown/app/references/changelog.md#4-0-0) | Added `isBrowser` command. |

## See also

*   [Browser Launch API](/llm/markdown/api/node-events/browser-launch-api.md)
*   [Cross Browser Testing](/llm/markdown/app/guides/cross-browser-testing.md)
*   [Cypress.browser](/llm/markdown/api/cypress-api/browser.md)
*   [Launching Browsers](/llm/markdown/app/references/launching-browsers.md)
*   [Test Configuration](/llm/markdown/app/references/configuration.md#Test-Configuration)
