{"id":25072374,"url":"https://github.com/googlechromelabs/chromium-bidi","last_synced_at":"2026-02-02T14:13:17.318Z","repository":{"id":37749201,"uuid":"377457305","full_name":"GoogleChromeLabs/chromium-bidi","owner":"GoogleChromeLabs","description":"Implementation of WebDriver BiDi for Chromium","archived":false,"fork":false,"pushed_at":"2025-05-07T18:01:48.000Z","size":7819,"stargazers_count":117,"open_issues_count":72,"forks_count":34,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-05-07T19:19:46.210Z","etag":null,"topics":["chrome","chromium","webdriver-bidi"],"latest_commit_sha":null,"homepage":"https://googlechromelabs.github.io/chromium-bidi/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GoogleChromeLabs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-06-16T10:26:51.000Z","updated_at":"2025-05-07T18:01:28.000Z","dependencies_parsed_at":"2022-07-14T06:10:36.983Z","dependency_job_id":"8aeda8f8-df4d-4692-8305-f89c50fefd54","html_url":"https://github.com/GoogleChromeLabs/chromium-bidi","commit_stats":{"total_commits":1322,"total_committers":14,"mean_commits":94.42857142857143,"dds":0.7208774583963691,"last_synced_commit":"9526a4aec88a16172b9a09b6996ac7c5ebbc7c21"},"previous_names":[],"tags_count":97,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoogleChromeLabs%2Fchromium-bidi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoogleChromeLabs%2Fchromium-bidi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoogleChromeLabs%2Fchromium-bidi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoogleChromeLabs%2Fchromium-bidi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GoogleChromeLabs","download_url":"https://codeload.github.com/GoogleChromeLabs/chromium-bidi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254198514,"owners_count":22030965,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chrome","chromium","webdriver-bidi"],"created_at":"2025-02-06T22:19:24.712Z","updated_at":"2026-02-02T14:13:17.304Z","avatar_url":"https://github.com/GoogleChromeLabs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WebDriver BiDi for Chromium [![chromium-bidi on npm](https://img.shields.io/npm/v/chromium-bidi)](https://www.npmjs.com/package/chromium-bidi)\n\n## CI status\n\n![E2E Tests](https://github.com/GoogleChromeLabs/chromium-bidi/actions/workflows/e2e.yml/badge.svg)\n![Unit Tests](https://github.com/GoogleChromeLabs/chromium-bidi/actions/workflows/unit.yml/badge.svg)\n![WPT Tests](https://github.com/GoogleChromeLabs/chromium-bidi/actions/workflows/wpt.yml/badge.svg)\n\n![Pre-commit](https://github.com/GoogleChromeLabs/chromium-bidi/actions/workflows/pre-commit.yml/badge.svg)\n\nThis is an implementation of the\n[WebDriver BiDi](https://w3c.github.io/webdriver-bidi/) protocol with some\nextensions (**BiDi+**)\nfor Chromium, implemented as a JavaScript layer translating between BiDi and CDP,\nrunning inside a Chrome tab.\n\nCurrent status can be checked\nat [WPT WebDriver BiDi status](https://wpt.fyi/results/webdriver/tests/bidi).\n\n## Performance Benchmarks\n\nThe project continuously monitors the performance and overhead of the WebDriver BiDi implementation.\n\n- **Dashboard:** [Chromium-BiDi Performance Benchmarks](https://googlechromelabs.github.io/chromium-bidi/bench/)\n- **Details:** Refer to [docs/benchmark.md](docs/benchmark.md) for detailed information about the benchmarking infrastructure, methodology, and statistical analysis.\n\nNote that performance data can be sensitive to CI environment fluctuations, especially on macOS.\n\n## BiDi+\n\n**\"BiDi+\"** is an extension of the WebDriver BiDi protocol. In addition to [WebDriver BiDi](https://w3c.github.io/webdriver-bidi/) it has:\n\n### Command `goog:cdp.sendCommand`\n\n```cddl\nCdpSendCommandCommand = {\n  method: \"goog:cdp.sendCommand\",\n  params: CdpSendCommandParameters,\n}\n\nCdpSendCommandParameters = {\n   method: text,\n   params: any,\n   session?: text,\n}\n\nCdpSendCommandResult = {\n   result: any,\n   session: text,\n}\n```\n\nThe command runs the\ndescribed [CDP command](https://chromedevtools.github.io/devtools-protocol)\nand returns the result.\n\n### Command `goog:cdp.getSession`\n\n```cddl\nCdpGetSessionCommand = {\n   method: \"goog:cdp.getSession\",\n   params: CdpGetSessionParameters,\n}\n\nCdpGetSessionParameters = {\n   context: BrowsingContext,\n}\n\nCdpGetSessionResult = {\n   session: text,\n}\n```\n\nThe command returns the default CDP session for the selected browsing context.\n\n### Command `goog:cdp.resolveRealm`\n\n```cddl\nCdpResolveRealmCommand = {\n   method: \"goog:cdp.resolveRealm\",\n   params: CdpResolveRealmParameters,\n}\n\nCdpResolveRealmParameters = {\n   realm: Script.Realm,\n}\n\nCdpResolveRealmResult = {\n   executionContextId: text,\n}\n```\n\nThe command returns resolves a BiDi realm to its CDP execution context ID.\n\n### Events `goog:cdp`\n\n```cddl\nCdpEventReceivedEvent = {\n   method: \"goog:cdp.\u003cCDP Event Name\u003e\",\n   params: CdpEventReceivedParameters,\n}\n\nCdpEventReceivedParameters = {\n   event: text,\n   params: any,\n   session: text,\n}\n```\n\nThe event contains a CDP event.\n\n### Field `goog:channel`\n\nEach command can be extended with a `goog:channel`:\n\n```cddl\nCommand = {\n   id: js-uint,\n   \"goog:channel\"?: text,\n   CommandData,\n   Extensible,\n}\n```\n\nIf provided and non-empty string, the very same `goog:channel` is added to the response:\n\n```cddl\nCommandResponse = {\n   id: js-uint,\n   \"goog:channel\"?: text,\n   result: ResultData,\n   Extensible,\n}\n\nErrorResponse = {\n  id: js-uint / null,\n  \"goog:channel\"?: text,\n  error: ErrorCode,\n  message: text,\n  ?stacktrace: text,\n  Extensible\n}\n```\n\nWhen client uses\ncommands [`session.subscribe`](https://w3c.github.io/webdriver-bidi/#command-session-subscribe)\nand [`session.unsubscribe`](https://w3c.github.io/webdriver-bidi/#command-session-unsubscribe)\nwith `goog:channel`, the subscriptions are handled per channel, and the corresponding\n`goog:channel` filed is added to the event message:\n\n```cddl\nEvent = {\n  \"goog:channel\"?: text,\n  EventData,\n  Extensible,\n}\n```\n\n## Dev Setup\n\n### `npm`\n\nThis is a Node.js project, so install dependencies as usual:\n\n```sh\nnpm install\n```\n\n### `cargo`\n\n\u003c!-- TODO(jrandolf): Remove after binaries get published --\u003e\n\nWe use [cddlconv](https://github.com/google/cddlconv) to generate our WebDriverBiDi types before building.\n\n1.  Install [Rust](https://rustup.rs/).\n2.  Run `cargo install --git https://github.com/google/cddlconv.git cddlconv`\n\n### pre-commit.com integration\n\nRefer to the documentation at [.pre-commit-config.yaml](.pre-commit-config.yaml).\n\n```sh\npre-commit install --hook-type pre-push\n```\n\nRe-installing pre-commit locally:\n\n```\npre-commit clean \u0026\u0026 pip install pre-commit\n```\n\n### Starting WebDriver BiDi Server\n\nThis will run the server on port `8080`:\n\n```sh\nnpm run server\n```\n\nUse the `PORT=` environment variable or `--port=` argument to run it on another port:\n\n```sh\nPORT=8081 npm run server\nnpm run server -- --port=8081\n```\n\nUse the `DEBUG` environment variable to see debug info:\n\n```sh\nDEBUG=* npm run server\n```\n\nUse the `DEBUG_DEPTH` (default: `10`) environment variable to see debug deeply nested objects:\n\n```sh\nDEBUG_DEPTH=100 DEBUG=* npm run server\n```\n\nUse the `CHANNEL=...` environment variable with one of the following values to run\nthe specific Chrome channel: `stable`, `beta`, `canary`, `dev`, `local`. Default is\n`local`. The `local` channel means the pinned in `.browser` Chrome version will be\ndownloaded if it is not yet in cache. Otherwise, the requested Chrome version should\nbe installed.\n\n```sh\nCHANNEL=dev npm run server\n```\n\nUse the CLI argument `--verbose` to have CDP events printed to the console. Note: you have to enable debugging output `bidi:mapper:debug:*` as well.\n\n```sh\nDEBUG=bidi:mapper:debug:* npm run server -- --verbose\n```\n\nor\n\n```sh\nDEBUG=* npm run server -- --verbose\n```\n\n### Starting on Linux and Mac\n\nTODO: verify it works on Windows.\n\nYou can also run the server by using `npm run server`. It will write\noutput to the file `log.txt`:\n\n```sh\nnpm run server -- --port=8081 --headless=false\n```\n\n### Running with in other project\n\nSometimes it good to verify that a change will not affect thing downstream for other packages.\nThere is a useful `puppeteer` label you can add to any PR to run Puppeteer test with your changes.\nIt will bundle `chromium-bidi` and install it in Puppeteer project then run that package test.\n\n## Running\n\n### Unit tests\n\nRunning:\n\n```sh\nnpm run unit\n```\n\n### E2E tests\n\nThe e2e tests serve the following purposes:\n\n1. Brief checks of the scenarios (the detailed check is done in WPT)\n2. Test Chromium-specific behavior nuances\n3. Add a simple setup for engaging the specific command\n\nThe E2E tests are written using Python, in order to more-or-less align with the web-platform-tests.\n\n#### Installation\n\nPython 3.10+ and some dependencies are required:\n\n```sh\npython -m pip install --user pipenv\npipenv install\n```\n\n#### Running\n\nThe E2E tests require BiDi server running on the same host. By default, tests\ntry to connect to the port `8080`. The server can be run from the project root:\n\n```sh\nnpm run e2e  # alias to to e2e:headless\nnpm run e2e:headful\nnpm run e2e:headless\n```\n\nThis commands will run `./tools/run-e2e.mjs`, which will log the PyTest output to console,\nAdditionally the output is also recorded under `./logs/\u003cDATE\u003e.e2e.log`, this will contain\nboth the PyTest logs and in the event of `FAILED` test all the Chromium-BiDi logs.\n\nIf you need to see the logs for all test run the command with `VERBOSE=true`.\n\nSimply pass `npm run e2e -- tests/\u003cPathOrFile\u003e` and the e2e will run only the selected one.\nYou run a specific test by running `npm run e2e -- -k \u003cTestName\u003e`.\n\nUse `CHROMEDRIVER` environment to run tests in `chromedriver` instead of NodeJS runner:\n\n```shell\nCHROMEDRIVER=true npm run e2e\n```\n\nUse the `PORT` environment variable to connect to another port:\n\n```sh\nPORT=8081 npm run e2e\n```\n\nUse the `HEADLESS` to run the tests in headless (new or old) or headful modes.\nValues: `new`, `old`, `false`, default: `new`.\n\n```sh\nHEADLESS=new npm run e2e\n```\n\n#### Updating snapshots\n\n```sh\nnpm run e2e -- --snapshot-update true\n```\n\nSee https://github.com/tophat/syrupy for more information.\n\n### Local http server\n\nE2E tests use local http\nserver [`pytest-httpserver`](https://pytest-httpserver.readthedocs.io/), which is run\nautomatically with the tests. However,\nsometimes it is useful to run the http server outside the test\ncase, for example for manual debugging. This can be done by running:\n\n```sh\npipenv run local_http_server\n```\n\n...or directly:\n\n```sh\npython tests/tools/local_http_server.py\n```\n\n### Examples\n\nRefer to [examples/README.md](examples/README.md).\n\n## WPT (Web Platform Tests)\n\nWPT is added as\na [git submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules). To get run\nWPT tests:\n\n### Check out and setup WPT\n\n#### 1. Check out WPT\n\n```sh\ngit submodule update --init\n```\n\n#### 2. Go to the WPT folder\n\n```sh\ncd wpt\n```\n\n#### 3. Set up virtualenv\n\nFollow the [_System\nSetup_](https://web-platform-tests.org/running-tests/from-local-system.html#system-setup)\ninstructions.\n\n#### 4. Setup `hosts` file\n\nFollow\nthe [`hosts` File Setup](https://web-platform-tests.org/running-tests/from-local-system.html#hosts-file-setup)\ninstructions.\n\n##### 4.a On Linux, macOS or other UNIX-like system\n\n```sh\n./wpt make-hosts-file | sudo tee -a /etc/hosts\n```\n\n##### 4.b On **Windows**\n\nThis must be run in a PowerShell session with Administrator privileges:\n\n```sh\npython wpt make-hosts-file | Out-File $env:SystemRoot\\System32\\drivers\\etc\\hosts -Encoding ascii -Append\n```\n\nIf you are behind a proxy, you also need to make sure the domains above are excluded\nfrom your proxy lookups.\n\n#### 5. Set `BROWSER_BIN`\n\nSet the `BROWSER_BIN` environment variable to a Chrome, Edge or Chromium binary to launch.\nFor example, on macOS:\n\n```sh\n# Chrome\nexport BROWSER_BIN=\"/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary\"\nexport BROWSER_BIN=\"/Applications/Google Chrome Dev.app/Contents/MacOS/Google Chrome Dev\"\nexport BROWSER_BIN=\"/Applications/Google Chrome Beta.app/Contents/MacOS/Google Chrome Beta\"\nexport BROWSER_BIN=\"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\"\nexport BROWSER_BIN=\"/Applications/Chromium.app/Contents/MacOS/Chromium\"\n\n# Edge\nexport BROWSER_BIN=\"/Applications/Microsoft Edge Canary.app/Contents/MacOS/Microsoft Edge Canary\"\nexport BROWSER_BIN=\"/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge\"\n```\n\n### Run WPT tests\n\n#### 1. Make sure you have Chrome Dev installed\n\nhttps://www.google.com/chrome/dev/\n\n#### 2. Build Chromedriver BiDi\n\nOneshot:\n\n```sh\nnpm run build\n```\n\nContinuously:\n\n```sh\nnpm run build --watch\n```\n\n#### 3. Run\n\n```sh\nnpm run wpt -- webdriver/tests/bidi/\n```\n\n### Update WPT expectations if needed\n\n```sh\nUPDATE_EXPECTATIONS=true npm run wpt -- webdriver/tests/bidi/\n```\n\n## How does it work?\n\nThe architecture is described in the\n[WebDriver BiDi in Chrome Context implementation plan](https://docs.google.com/document/d/1VfQ9tv0wPSnb5TI-MOobjoQ5CXLnJJx9F_PxOMQc8kY)\n.\n\nThere are 2 main modules:\n\n1. backend WS server in `src`. It runs webSocket server, and for each ws connection\n   runs an instance of browser with BiDi Mapper.\n2. front-end BiDi Mapper in `src/bidiMapper`. Gets BiDi commands from the backend,\n   and map them to CDP commands.\n\n## Contributing\n\nThe BiDi commands are processed in the `src/bidiMapper/commandProcessor.ts`. To add a\nnew command, add it to `_processCommand`, write and call processor for it.\n\n### Publish new `npm` release\n\n#### Release branches\n\n`chromium-bidi` maintains release branches corresponding to Chrome releases. The\nbranches are named using the following pattern: `releases/m$MAJOR_VERSION`.\n\nThe new release branch is created as soon a new major browser version is\npublished by the\n[update-browser-version](https://github.com/GoogleChromeLabs/chromium-bidi/blob/main/.github/workflows/update-browser-version.yml)\njob:\n\n- the PR created by this job should be marked as a feature and it should cause the\n  major package version to be bumped.\n- once the browser version is bumped, the commit preceding the version bump\n  should be used to create a release branch for major version pinned before the bump.\n\nChanges that need to be cherry-picked into the release branch should be marked\nas patches. Either major or minor version bumps are not allowed on the release\nbranch.\n\nExample workflow:\n\n```mermaid\ngitGraph\n       commit id: \"feat: featA\"\n       commit id: \"release: v0.5.0\"\n       branch release/m129\n       checkout main\n       commit id: \"feat: roll Chrome to M130 from 129\"\n       commit id: \"release: v0.6.0\"\n       commit id: \"fix: for m129\"\n       checkout release/m129\n       cherry-pick id: \"fix: for m129\"\n       commit id: \"release: v0.5.1 \"\n```\n\nCurrently, the releases from release branches are not automated.\n\n#### Automatic release\n\nWe use [release-please](https://github.com/googleapis/release-please) to automate releases. When a release should be done, check for the release PR in our [pull requests](https://github.com/GoogleChromeLabs/chromium-bidi/pulls) and merge it.\n\n#### Manual release\n\n1. Dry-run\n\n   ```sh\n   npm publish --dry-run\n   ```\n\n1. Open a PR bumping the chromium-bidi version number in `package.json` for review:\n\n   ```sh\n   npm version patch -m 'chore: Release v%s' --no-git-tag-version\n   ```\n\n   Instead of `patch`, use `minor` or `major` [as needed](https://semver.org/).\n\n1. After the PR is reviewed, [create a GitHub release](https://github.com/GoogleChromeLabs/chromium-bidi/releases/new) specifying the tag name matching the bumped version.\n   Our CI then automatically publishes the new release to npm based on the tag name.\n\n#### Roll into Chromium\n\nThis section assumes you already have a Chromium set-up locally,\nand knowledge on [how to submit changes to the repo](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/contributing.md).\nOtherwise submit an issue for a project maintainer.\n\n1. Create a new branch in chromium `src/`.\n2. Update the mapper version:\n\n```shell\nthird_party/bidimapper/roll_bidimapper\n```\n\n3. Submit a CL with bug `42323268` ([link](https://crbug.com/42323268)).\n\n4. [Regenerate WPT expectations or baselines](https://chromium.googlesource.com/chromium/src/+/HEAD/docs/testing/run_web_platform_tests.md#test-expectations-and-baselines):\n\n   4.1. Trigger a build and test run:\n\n   ```shell\n   third_party/blink/tools/blink_tool.py rebaseline-cl --build=\"linux-blink-rel\" --verbose\n   ```\n\n   4.2. Once the test completes on the builder, rerun that command to update the\n   baselines. Update test expectations if there are any crashes or timeouts.\n   Commit the changes (if any), and upload the new patch to the CL.\n\n5. Add appropriate reviewers or comment the CL link on the PR.\n\n## Adding new command\n\nWant to add a shiny new command to WebDriver BiDi for Chromium? Here's the playbook:\n\n### Prerequisites\n\n#### Specification\n\nThe WebDriver BiDi [module](https://w3c.github.io/webdriver-bidi/#protocol-modules), [command](https://w3c.github.io/webdriver-bidi/#commands), or [event](https://w3c.github.io/webdriver-bidi/#events) must be specified either in the [WebDriver BiDi specification](https://w3c.github.io/webdriver-bidi) or as an extension in a separate specification (e.g., the [Permissions specification](https://www.w3.org/TR/permissions/#automation-webdriver-bidi)). The specification should include the command's type definitions in valid [CDDL](https://datatracker.ietf.org/doc/html/rfc8610) format.\n\n#### WPT wdspec tests\n\nYou'll need tests to prove your command works as expected. These tests should be written using [WPT wdspec](https://web-platform-tests.org/writing-tests/wdspec.html) and submitted along with the spec itself. Don't forget to roll the WPT repo into the Mapper ([dependabot](https://github.com/GoogleChromeLabs/chromium-bidi/network/updates/10663151/jobs) can help, and you will likely need to tweak some expectations afterward).\n\n#### CDP implementation\n\nMake sure Chromium already has the CDP methods your command will rely on.\n\n### Update CDDL types\n\n1. If your command lives in a separate spec, add a link to that spec in the [\"Build WebDriverBiDi types\"](https://github.com/GoogleChromeLabs/chromium-bidi/blob/0f971303281aba1910786035facc5eb54a833232/.github/workflows/update-bidi-types.yml#L27) GitHub action (check out the [\"bluetooth\" pull request](https://github.com/GoogleChromeLabs/chromium-bidi/pull/2585) for an example).\n2. Run the [\"Update WebdriverBiDi types\"](https://github.com/GoogleChromeLabs/chromium-bidi/actions/workflows/update-bidi-types.yml) GitHub action. This will create a pull request with your new types. If you added a command, this PR will have a failing check complaining about a non-exhaustive switch statement:\n   \u003e error: Switch is not exhaustive. Cases not matched: \"{NEW_COMMAND_NAME}\" @typescript-eslint/switch-exhaustiveness-check\n3. Update the created pull request. Add your new command to [`CommandProcessor.#processCommand`](https://github.com/GoogleChromeLabs/chromium-bidi/blob/0f971303281aba1910786035facc5eb54a833232/src/bidiMapper/CommandProcessor.ts#L140). For now, just have it throw an UnknownErrorException (see the [example](https://github.com/GoogleChromeLabs/chromium-bidi/pull/2647/files#diff-7f06ce28b8514fd75b759d217bff9f5a471b657bcf78bd893cc291c7945c1cacR169) for how to do this).\n\n```typescript\ncase '{NEW_COMMAND_NAME}':\n  throw new UnknownErrorException(\n    `Method ${command.method} is not implemented.`,\n  );\n```\n\n4. Merge it! Standard PR process: create, review, merge.\n\n### Implement the new command\n\n[`CommandProcessor.#processCommand`](https://github.com/GoogleChromeLabs/chromium-bidi/blob/0f971303281aba1910786035facc5eb54a833232/src/bidiMapper/CommandProcessor.ts#L140) handles parsing parameters and running your command.\n\n#### (only if the new command has non-empty parameters) parse command parameters\n\nIf your command has parameters, update the [`BidiCommandParameterParser`](https://github.com/GoogleChromeLabs/chromium-bidi/blob/0f971303281aba1910786035facc5eb54a833232/src/bidiMapper/BidiParser.ts#L31) and implement the parsing logic in [`BidiNoOpParser`](https://github.com/GoogleChromeLabs/chromium-bidi/blob/0f971303281aba1910786035facc5eb54a833232/src/bidiMapper/BidiNoOpParser.ts#L209), [`BidiParser`](https://github.com/GoogleChromeLabs/chromium-bidi/blob/0f971303281aba1910786035facc5eb54a833232/src/bidiTab/BidiParser.ts#L182) and [`protocol-parser`](https://github.com/GoogleChromeLabs/chromium-bidi/blob/0f971303281aba1910786035facc5eb54a833232/src/protocol-parser/protocol-parser.ts#L386). Look at the [example](https://github.com/GoogleChromeLabs/chromium-bidi/blob/0f971303281aba1910786035facc5eb54a833232/src/bidiMapper/BidiParser.ts#L97) for guidance.\n\n#### Implement the new command\n\nWrite the core logic for your command in the appropriate domain processor. Again, [example](https://github.com/GoogleChromeLabs/chromium-bidi/blob/0f971303281aba1910786035facc5eb54a833232/src/bidiMapper/modules/permissions/PermissionsProcessor.ts#L32) is your friend.\n\n#### Call the module processor's method\n\nCall your new module processor method from `CommandProcessor.#processCommand`, passing in the parsed parameters. [Example](https://github.com/GoogleChromeLabs/chromium-bidi/blob/0f971303281aba1910786035facc5eb54a833232/src/bidiMapper/CommandProcessor.ts#L313).\n\n#### Add e2e tests\n\nWrite end-to-end tests for your command, including the happy path and any edge cases that might trip things up. Focus on testing the code in the mapper.\n\n#### Update WPT expectations\n\nYour WPT tests will probably fail now.\n\n\u003e Tests with unexpected results: PASS [expected FAIL] ...\n\nUpdate the expectations in a draft PR with the \"update-expectations\" label. This will trigger an automated PR \"test: update the expectations for PR\" that you'll need to merge to your branch.\n\n#### Merge it!\n\nMark your PR as ready, get it reviewed, and merge it in.\n\n### Roll in ChromeDriver\n\nThis bit usually involves the core devs:\n\n1. [Release](#automatic-release) your changes.\n2. [Roll the changes into ChromeDriver](#roll-into-chromium).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgooglechromelabs%2Fchromium-bidi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgooglechromelabs%2Fchromium-bidi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgooglechromelabs%2Fchromium-bidi/lists"}