{
  "doc": {
    "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": "/llm/markdown/api/cypress-api/isbrowser.md",
    "version": "524ff5211e60b5d53e55d6ad976d83966f66e7cd",
    "updated_at": "2026-04-30T14:20:05.396Z",
    "headings": [
      {
        "id": "api/cypress-api/isbrowser#cypress-isbrowser",
        "text": "Cypress.isBrowser",
        "level": 1
      },
      {
        "id": "api/cypress-api/isbrowser#syntax",
        "text": "Syntax",
        "level": 2
      },
      {
        "id": "api/cypress-api/isbrowser#arguments",
        "text": "Arguments",
        "level": 3
      },
      {
        "id": "api/cypress-api/isbrowser#examples",
        "text": "Examples",
        "level": 2
      },
      {
        "id": "api/cypress-api/isbrowser#matcher",
        "text": "Matcher",
        "level": 3
      },
      {
        "id": "api/cypress-api/isbrowser#only-run-command-in-chrome",
        "text": "Only run command in Chrome",
        "level": 4
      },
      {
        "id": "api/cypress-api/isbrowser#run-command-in-all-browsers-except-chrome",
        "text": "Run command in all browsers except Chrome",
        "level": 4
      },
      {
        "id": "api/cypress-api/isbrowser#matchers",
        "text": "Matchers",
        "level": 3
      },
      {
        "id": "api/cypress-api/isbrowser#run-commands-in-all-specified-browsers",
        "text": "Run commands in all specified browsers",
        "level": 4
      },
      {
        "id": "api/cypress-api/isbrowser#run-commands-in-all-browsers-except-specified",
        "text": "Run commands in all browsers except specified",
        "level": 4
      },
      {
        "id": "api/cypress-api/isbrowser#filter",
        "text": "Filter",
        "level": 3
      },
      {
        "id": "api/cypress-api/isbrowser#only-run-commands-in-chromium-based-browser",
        "text": "Only run commands in Chromium-based browser",
        "level": 4
      },
      {
        "id": "api/cypress-api/isbrowser#only-run-on-stable-release-in-chromium-based-browser",
        "text": "Only run on stable release in Chromium-based browser",
        "level": 4
      },
      {
        "id": "api/cypress-api/isbrowser#only-run-on-specific-release-channels-of-browsers",
        "text": "Only run on specific release channels of browsers",
        "level": 4
      },
      {
        "id": "api/cypress-api/isbrowser#notes",
        "text": "Notes",
        "level": 3
      },
      {
        "id": "api/cypress-api/isbrowser#test-configuration-browser",
        "text": "Test configuration: browser",
        "level": 4
      },
      {
        "id": "api/cypress-api/isbrowser#history",
        "text": "History",
        "level": 2
      },
      {
        "id": "api/cypress-api/isbrowser#see-also",
        "text": "See also",
        "level": 2
      }
    ]
  },
  "content": {
    "type": "root",
    "children": [
      {
        "type": "heading",
        "depth": 1,
        "children": [
          {
            "type": "text",
            "value": "Cypress.isBrowser"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "`Cypress.isBrowser` checks if the current browser matches the given name or filter."
          }
        ]
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Syntax"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "Cypress.isBrowser(matcher)Cypress.isBrowser(matchers)Cypress.isBrowser(filter)"
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Arguments"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "matcher (String)"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "The name of the browser (case-insensitive) you want to check against. Name can be prepended with a `!` character to inverse the check."
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "matchers (Array)"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "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."
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "filter (Object or Array)"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Filter one or multiple browsers by the browser properties. You can inspect the current browser's properties by using the "
          },
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/api/cypress-api/browser.md",
            "children": [
              {
                "type": "text",
                "value": "Cypress.browser"
              }
            ]
          },
          {
            "type": "text",
            "value": ". Supported properties are:"
          }
        ]
      },
      {
        "type": "table",
        "align": [
          null,
          null,
          null
        ],
        "children": [
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Property"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Type"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Description"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "`name`"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "`string`"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Machine-friendly name, like `chrome`, `electron`, or `firefox`."
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "`family`"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "`string`"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Rendering engine being used. `chromium` or `firefox`."
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "`channel`"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "`string`"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Release channel of the browser, such as `stable`, `dev`, or `canary`."
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "`displayName`"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "`string`"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Human-readable display name for the browser."
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "`version`"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "`string`"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Full version."
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "`path`"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "`string`"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Path to the browser on disk. Blank for Electron."
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "`majorVersion`"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "`number`"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "`string`"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "The major version number of the browser."
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "`isHeadless`"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "`boolean`"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Whether the browser is running headlessly."
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "`isHeaded`"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "`boolean`"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Whether the browser displays headed."
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Examples"
          }
        ]
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Matcher"
          }
        ]
      },
      {
        "type": "heading",
        "depth": 4,
        "children": [
          {
            "type": "text",
            "value": "Only run command in Chrome"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "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')  }})"
      },
      {
        "type": "heading",
        "depth": 4,
        "children": [
          {
            "type": "text",
            "value": "Run command in all browsers except Chrome"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "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'    )  }})"
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Matchers"
          }
        ]
      },
      {
        "type": "heading",
        "depth": 4,
        "children": [
          {
            "type": "text",
            "value": "Run commands in all specified browsers"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "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)'    )  }})"
      },
      {
        "type": "heading",
        "depth": 4,
        "children": [
          {
            "type": "text",
            "value": "Run commands in all browsers except specified"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "// 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')  }})"
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Filter"
          }
        ]
      },
      {
        "type": "heading",
        "depth": 4,
        "children": [
          {
            "type": "text",
            "value": "Only run commands in Chromium-based browser"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "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')  }})"
      },
      {
        "type": "heading",
        "depth": 4,
        "children": [
          {
            "type": "text",
            "value": "Only run on stable release in Chromium-based browser"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "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  }})"
      },
      {
        "type": "heading",
        "depth": 4,
        "children": [
          {
            "type": "text",
            "value": "Only run on specific release channels of browsers"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "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  }})"
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Notes"
          }
        ]
      },
      {
        "type": "heading",
        "depth": 4,
        "children": [
          {
            "type": "text",
            "value": "Test configuration: `browser`"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "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 "
          },
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/app/references/configuration.md#Test-Configuration",
            "children": [
              {
                "type": "text",
                "value": "test configuration"
              }
            ]
          },
          {
            "type": "text",
            "value": ". The `browser` option accepts the same "
          },
          {
            "type": "link",
            "title": null,
            "url": "#Arguments",
            "children": [
              {
                "type": "text",
                "value": "arguments"
              }
            ]
          },
          {
            "type": "text",
            "value": " as `Cypress.isBrowser()`."
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "it('Download extension in Firefox', { browser: 'firefox' }, () => {  cy.get('#dl-extension').should('contain', 'Download Firefox Extension')})"
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "it('Show warning outside Chrome', { browser: '!chrome' }, () => {  cy.get('.browser-warning').should(    'contain',    'For optimal viewing, use Chrome browser'  )})"
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "History"
          }
        ]
      },
      {
        "type": "table",
        "align": [
          null,
          null
        ],
        "children": [
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Version"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Changes"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "/llm/markdown/app/references/changelog.md#4-8-0",
                    "children": [
                      {
                        "type": "text",
                        "value": "4.8.0"
                      }
                    ]
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Expanded `matcher` and `matchers` arguments to assist in filtering browsers."
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "/llm/markdown/app/references/changelog.md#4-0-0",
                    "children": [
                      {
                        "type": "text",
                        "value": "4.0.0"
                      }
                    ]
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Added `isBrowser` command."
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "See also"
          }
        ]
      },
      {
        "type": "list",
        "ordered": false,
        "start": null,
        "spread": false,
        "children": [
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "/llm/markdown/api/node-events/browser-launch-api.md",
                    "children": [
                      {
                        "type": "text",
                        "value": "Browser Launch API"
                      }
                    ]
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "/llm/markdown/app/guides/cross-browser-testing.md",
                    "children": [
                      {
                        "type": "text",
                        "value": "Cross Browser Testing"
                      }
                    ]
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "/llm/markdown/api/cypress-api/browser.md",
                    "children": [
                      {
                        "type": "text",
                        "value": "Cypress.browser"
                      }
                    ]
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "/llm/markdown/app/references/launching-browsers.md",
                    "children": [
                      {
                        "type": "text",
                        "value": "Launching Browsers"
                      }
                    ]
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "/llm/markdown/app/references/configuration.md#Test-Configuration",
                    "children": [
                      {
                        "type": "text",
                        "value": "Test Configuration"
                      }
                    ]
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  },
  "token_estimate": 887
}