{
  "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": "e6988a974973e9090ce70406c38cb2b9e0eac9fa",
    "updated_at": "2026-05-15T15:50:22.536Z",
    "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
      }
    ]
  },
  "chunks": [
    {
      "id": "api/cypress-api/isbrowser#syntax",
      "doc_id": "api/cypress-api/isbrowser",
      "heading": "Syntax",
      "heading_level": 2,
      "content_markdown": "## Syntax\n\n```\nCypress.isBrowser(matcher)Cypress.isBrowser(matchers)Cypress.isBrowser(filter)\n```\n\n### Arguments\n\n**matcher _(String)_**\n\nThe name of the browser (case-insensitive) you want to check against. Name can be prepended with a `!` character to inverse the check.\n\n**matchers _(Array)_**\n\nAn 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.\n\n**filter _(Object or Array)_**\n\nFilter 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:\n\n| Property | Type | Description |\n| --- | --- | --- |\n| `name` | `string` | Machine-friendly name, like `chrome`, `electron`, or `firefox`. |\n| `family` | `string` | Rendering engine being used. `chromium` or `firefox`. |\n| `channel` | `string` | Release channel of the browser, such as `stable`, `dev`, or `canary`. |\n| `displayName` | `string` | Human-readable display name for the browser. |\n| `version` | `string` | Full version. |\n| `path` | `string` | Path to the browser on disk. Blank for Electron. |\n| `majorVersion` | `number` | `string` | The major version number of the browser. |\n| `isHeadless` | `boolean` | Whether the browser is running headlessly. |\n| `isHeaded` | `boolean` | Whether the browser displays headed. |\n",
      "section": "api",
      "anchors": [
        "syntax"
      ],
      "path": "/llm/json/chunked/api/cypress-api/isbrowser.json",
      "token_estimate": 289
    },
    {
      "id": "api/cypress-api/isbrowser#arguments",
      "doc_id": "api/cypress-api/isbrowser",
      "heading": "Arguments",
      "heading_level": 3,
      "content_markdown": "### Arguments\n\n**matcher _(String)_**\n\nThe name of the browser (case-insensitive) you want to check against. Name can be prepended with a `!` character to inverse the check.\n\n**matchers _(Array)_**\n\nAn 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.\n\n**filter _(Object or Array)_**\n\nFilter 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:\n\n| Property | Type | Description |\n| --- | --- | --- |\n| `name` | `string` | Machine-friendly name, like `chrome`, `electron`, or `firefox`. |\n| `family` | `string` | Rendering engine being used. `chromium` or `firefox`. |\n| `channel` | `string` | Release channel of the browser, such as `stable`, `dev`, or `canary`. |\n| `displayName` | `string` | Human-readable display name for the browser. |\n| `version` | `string` | Full version. |\n| `path` | `string` | Path to the browser on disk. Blank for Electron. |\n| `majorVersion` | `number` | `string` | The major version number of the browser. |\n| `isHeadless` | `boolean` | Whether the browser is running headlessly. |\n| `isHeaded` | `boolean` | Whether the browser displays headed. |\n",
      "section": "api",
      "anchors": [
        "arguments"
      ],
      "path": "/llm/json/chunked/api/cypress-api/isbrowser.json",
      "token_estimate": 283
    },
    {
      "id": "api/cypress-api/isbrowser#examples",
      "doc_id": "api/cypress-api/isbrowser",
      "heading": "Examples",
      "heading_level": 2,
      "content_markdown": "## Examples\n\n### Matcher\n\n#### Only run command in Chrome\n\n```\nit('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')  }})\n```\n\n#### Run command in all browsers except Chrome\n\n```\nit('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'    )  }})\n```\n\n### Matchers\n\n#### Run commands in all specified browsers\n\n```\nit('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)'    )  }})\n```\n\n#### Run commands in all browsers except specified\n\n```\n// 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')  }})\n```\n\n### Filter\n\n#### Only run commands in Chromium-based browser\n\n```\nit('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')  }})\n```\n\n#### Only run on stable release in Chromium-based browser\n\n```\nit('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  }})\n```\n\n#### Only run on specific release channels of browsers\n\n```\nit('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  }})\n```\n\n### Notes\n\n#### Test configuration: `browser`\n\nIf 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()`.\n\n```\nit('Download extension in Firefox', { browser: 'firefox' }, () => {  cy.get('#dl-extension').should('contain', 'Download Firefox Extension')})\n```\n\n```\nit('Show warning outside Chrome', { browser: '!chrome' }, () => {  cy.get('.browser-warning').should(    'contain',    'For optimal viewing, use Chrome browser'  )})\n```\n",
      "section": "api",
      "anchors": [
        "examples"
      ],
      "path": "/llm/json/chunked/api/cypress-api/isbrowser.json",
      "token_estimate": 509
    },
    {
      "id": "api/cypress-api/isbrowser#matcher",
      "doc_id": "api/cypress-api/isbrowser",
      "heading": "Matcher",
      "heading_level": 3,
      "content_markdown": "### Matcher\n\n#### Only run command in Chrome\n\n```\nit('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')  }})\n```\n\n#### Run command in all browsers except Chrome\n\n```\nit('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'    )  }})\n```\n",
      "section": "api",
      "anchors": [
        "matcher"
      ],
      "path": "/llm/json/chunked/api/cypress-api/isbrowser.json",
      "token_estimate": 112
    },
    {
      "id": "api/cypress-api/isbrowser#only-run-command-in-chrome",
      "doc_id": "api/cypress-api/isbrowser",
      "heading": "Only run command in Chrome",
      "heading_level": 4,
      "content_markdown": "#### Only run command in Chrome\n\n```\nit('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')  }})\n```\n",
      "section": "api",
      "anchors": [
        "only-run-command-in-chrome"
      ],
      "path": "/llm/json/chunked/api/cypress-api/isbrowser.json",
      "token_estimate": 56
    },
    {
      "id": "api/cypress-api/isbrowser#run-command-in-all-browsers-except-chrome",
      "doc_id": "api/cypress-api/isbrowser",
      "heading": "Run command in all browsers except Chrome",
      "heading_level": 4,
      "content_markdown": "#### Run command in all browsers except Chrome\n\n```\nit('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'    )  }})\n```\n",
      "section": "api",
      "anchors": [
        "run-command-in-all-browsers-except-chrome"
      ],
      "path": "/llm/json/chunked/api/cypress-api/isbrowser.json",
      "token_estimate": 53
    },
    {
      "id": "api/cypress-api/isbrowser#matchers",
      "doc_id": "api/cypress-api/isbrowser",
      "heading": "Matchers",
      "heading_level": 3,
      "content_markdown": "### Matchers\n\n#### Run commands in all specified browsers\n\n```\nit('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)'    )  }})\n```\n\n#### Run commands in all browsers except specified\n\n```\n// 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')  }})\n```\n",
      "section": "api",
      "anchors": [
        "matchers"
      ],
      "path": "/llm/json/chunked/api/cypress-api/isbrowser.json",
      "token_estimate": 100
    },
    {
      "id": "api/cypress-api/isbrowser#run-commands-in-all-specified-browsers",
      "doc_id": "api/cypress-api/isbrowser",
      "heading": "Run commands in all specified browsers",
      "heading_level": 4,
      "content_markdown": "#### Run commands in all specified browsers\n\n```\nit('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)'    )  }})\n```\n",
      "section": "api",
      "anchors": [
        "run-commands-in-all-specified-browsers"
      ],
      "path": "/llm/json/chunked/api/cypress-api/isbrowser.json",
      "token_estimate": 47
    },
    {
      "id": "api/cypress-api/isbrowser#run-commands-in-all-browsers-except-specified",
      "doc_id": "api/cypress-api/isbrowser",
      "heading": "Run commands in all browsers except specified",
      "heading_level": 4,
      "content_markdown": "#### Run commands in all browsers except specified\n\n```\n// 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')  }})\n```\n",
      "section": "api",
      "anchors": [
        "run-commands-in-all-browsers-except-specified"
      ],
      "path": "/llm/json/chunked/api/cypress-api/isbrowser.json",
      "token_estimate": 51
    },
    {
      "id": "api/cypress-api/isbrowser#filter",
      "doc_id": "api/cypress-api/isbrowser",
      "heading": "Filter",
      "heading_level": 3,
      "content_markdown": "### Filter\n\n#### Only run commands in Chromium-based browser\n\n```\nit('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')  }})\n```\n\n#### Only run on stable release in Chromium-based browser\n\n```\nit('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  }})\n```\n\n#### Only run on specific release channels of browsers\n\n```\nit('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  }})\n```\n",
      "section": "api",
      "anchors": [
        "filter"
      ],
      "path": "/llm/json/chunked/api/cypress-api/isbrowser.json",
      "token_estimate": 184
    },
    {
      "id": "api/cypress-api/isbrowser#only-run-commands-in-chromium-based-browser",
      "doc_id": "api/cypress-api/isbrowser",
      "heading": "Only run commands in Chromium-based browser",
      "heading_level": 4,
      "content_markdown": "#### Only run commands in Chromium-based browser\n\n```\nit('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')  }})\n```\n",
      "section": "api",
      "anchors": [
        "only-run-commands-in-chromium-based-browser"
      ],
      "path": "/llm/json/chunked/api/cypress-api/isbrowser.json",
      "token_estimate": 53
    },
    {
      "id": "api/cypress-api/isbrowser#only-run-on-stable-release-in-chromium-based-browser",
      "doc_id": "api/cypress-api/isbrowser",
      "heading": "Only run on stable release in Chromium-based browser",
      "heading_level": 4,
      "content_markdown": "#### Only run on stable release in Chromium-based browser\n\n```\nit('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  }})\n```\n",
      "section": "api",
      "anchors": [
        "only-run-on-stable-release-in-chromium-based-browser"
      ],
      "path": "/llm/json/chunked/api/cypress-api/isbrowser.json",
      "token_estimate": 57
    },
    {
      "id": "api/cypress-api/isbrowser#only-run-on-specific-release-channels-of-browsers",
      "doc_id": "api/cypress-api/isbrowser",
      "heading": "Only run on specific release channels of browsers",
      "heading_level": 4,
      "content_markdown": "#### Only run on specific release channels of browsers\n\n```\nit('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  }})\n```\n",
      "section": "api",
      "anchors": [
        "only-run-on-specific-release-channels-of-browsers"
      ],
      "path": "/llm/json/chunked/api/cypress-api/isbrowser.json",
      "token_estimate": 71
    },
    {
      "id": "api/cypress-api/isbrowser#notes",
      "doc_id": "api/cypress-api/isbrowser",
      "heading": "Notes",
      "heading_level": 3,
      "content_markdown": "### Notes\n\n#### Test configuration: `browser`\n\nIf 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()`.\n\n```\nit('Download extension in Firefox', { browser: 'firefox' }, () => {  cy.get('#dl-extension').should('contain', 'Download Firefox Extension')})\n```\n\n```\nit('Show warning outside Chrome', { browser: '!chrome' }, () => {  cy.get('.browser-warning').should(    'contain',    'For optimal viewing, use Chrome browser'  )})\n```\n",
      "section": "api",
      "anchors": [
        "notes"
      ],
      "path": "/llm/json/chunked/api/cypress-api/isbrowser.json",
      "token_estimate": 111
    },
    {
      "id": "api/cypress-api/isbrowser#test-configuration-browser",
      "doc_id": "api/cypress-api/isbrowser",
      "heading": "Test configuration: browser",
      "heading_level": 4,
      "content_markdown": "#### Test configuration: `browser`\n\nIf 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()`.\n\n```\nit('Download extension in Firefox', { browser: 'firefox' }, () => {  cy.get('#dl-extension').should('contain', 'Download Firefox Extension')})\n```\n\n```\nit('Show warning outside Chrome', { browser: '!chrome' }, () => {  cy.get('.browser-warning').should(    'contain',    'For optimal viewing, use Chrome browser'  )})\n```\n",
      "section": "api",
      "anchors": [
        "test-configuration-browser"
      ],
      "path": "/llm/json/chunked/api/cypress-api/isbrowser.json",
      "token_estimate": 108
    },
    {
      "id": "api/cypress-api/isbrowser#history",
      "doc_id": "api/cypress-api/isbrowser",
      "heading": "History",
      "heading_level": 2,
      "content_markdown": "## History\n\n| Version | Changes |\n| --- | --- |\n| [4.8.0](/llm/markdown/app/references/changelog.md#4-8-0) | Expanded `matcher` and `matchers` arguments to assist in filtering browsers. |\n| [4.0.0](/llm/markdown/app/references/changelog.md#4-0-0) | Added `isBrowser` command. |\n",
      "section": "api",
      "anchors": [
        "history"
      ],
      "path": "/llm/json/chunked/api/cypress-api/isbrowser.json",
      "token_estimate": 44
    }
  ]
}