{"_id":"chromium-bidi","_rev":"226336","name":"chromium-bidi","description":"An implementation of the WebDriver BiDi protocol for Chromium implemented as a JavaScript layer translating between BiDi and CDP, running inside a Chrome tab.","dist-tags":{"latest":"0.4.5"},"maintainers":[{"name":"google-wombot","email":""},{"name":"mathias","email":""}],"time":{"modified":"2023-03-24T09:57:08.000Z","created":"2022-04-28T08:05:04.228Z","0.4.5":"2023-03-01T15:00:12.595Z","0.4.4":"2023-02-17T10:29:26.450Z","0.4.3":"2022-12-13T13:30:24.879Z","0.4.2":"2022-05-06T11:58:12.076Z","0.1.2":"2022-04-28T08:56:34.057Z","0.0.0":"2022-04-28T08:05:04.228Z"},"users":{},"author":{"name":"The Chromium Authors"},"repository":{"type":"git","url":"git+https://github.com/GoogleChromeLabs/chromium-bidi.git"},"versions":{"0.4.5":{"name":"chromium-bidi","version":"0.4.5","description":"An implementation of the WebDriver BiDi protocol for Chromium implemented as a JavaScript layer translating between BiDi and CDP, running inside a Chrome tab.","scripts":{"build":"tsc -b src/tsconfig.json && npm run rollup","clean":"rimraf lib","e2e-headful":"npm run server-no-build -- --headless=false & npm run e2e-only","e2e-headless":"npm run server-no-build & npm run e2e-only","e2e":"npm run e2e-headless","e2e-only":"python3 -m pytest","eslint":"eslint --ext js --ext ts --fix .","format":"npm run eslint && npm run prettier & npm run yapf","prepare":"npm run clean && npm run build","prettier":"prettier --write .","rollup":"rollup -c","server":"npm run build && npm run server-no-build --","server-no-build":"node lib/cjs/bidiServer/index.js","test":"npm run build && mocha","watch":"tsc -b src/tsconfig.json --watch & rollup -c --watch","yapf":"yapf --in-place --parallel --recursive --exclude=wpt examples/ tests/"},"repository":{"type":"git","url":"git+https://github.com/GoogleChromeLabs/chromium-bidi.git"},"author":{"name":"The Chromium Authors"},"license":"Apache-2.0","peerDependencies":{"devtools-protocol":"*"},"devDependencies":{"@rollup/plugin-commonjs":"22.0.0","@rollup/plugin-node-resolve":"13.3.0","@rollup/plugin-terser":"^0.3.0","@types/argparse":"2.0.10","@types/chai":"4.3.1","@types/chai-as-promised":"7.1.5","@types/debug":"4.1.7","@types/mocha":"9.1.1","@types/node":"18.11.14","@types/sinon":"10.0.11","@types/websocket":"1.0.5","@types/ws":"8.5.3","@typescript-eslint/eslint-plugin":"5.38.0","@typescript-eslint/parser":"5.38.0","argparse":"2.0.1","chai":"4.3.6","chai-as-promised":"7.1.1","chai-exclude":"2.1.0","debug":"4.3.4","devtools-protocol":"0.0.1007249","eslint":"8.24.0","eslint-config-prettier":"8.5.0","eslint-plugin-import":"2.26.0","eslint-plugin-mocha":"10.1.0","eslint-plugin-prettier":"4.2.1","gts":"3.1.1","mocha":"10.0.0","prettier":"2.6.2","puppeteer":"19.3.0","rimraf":"3.0.2","rollup":"2.74.1","sinon":"14.0.0","terser":"5.14.2","tslib":"2.4.0","typescript":"4.7.2","websocket":"1.0.34","ws":"8.6.0","zod":"3.17.3"},"dependencies":{"mitt":"3.0.0"},"gitHead":"f08dca30e2010c474c9c99d0764b4c97e663e984","bugs":{"url":"https://github.com/GoogleChromeLabs/chromium-bidi/issues"},"homepage":"https://github.com/GoogleChromeLabs/chromium-bidi#readme","_id":"chromium-bidi@0.4.5","_nodeVersion":"16.19.1","_npmVersion":"8.19.3","dist":{"shasum":"a352e755536dde609bd2c77e4b1f0906bff8784e","size":213643,"noattachment":false,"key":"/chromium-bidi/-/chromium-bidi-0.4.5.tgz","tarball":"http://name.csiicloud.com:7001/chromium-bidi/download/chromium-bidi-0.4.5.tgz"},"_npmUser":{"name":"google-wombot","email":"node-team-npm+wombot@google.com"},"directories":{},"maintainers":[{"name":"google-wombot","email":""},{"name":"mathias","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/chromium-bidi_0.4.5_1677682812402_0.35603349656810823"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-03-01T15:00:12.595Z","publish_time":1677682812595,"_cnpm_publish_time":1677682812595},"0.4.4":{"name":"chromium-bidi","version":"0.4.4","description":"An implementation of the WebDriver BiDi protocol for Chromium implemented as a JavaScript layer translating between BiDi and CDP, running inside a Chrome tab.","scripts":{"build":"tsc -b src/tsconfig.json && npm run rollup","clean":"rimraf lib","e2e-headful":"npm run server-no-build -- --headless=false & npm run e2e-only","e2e-headless":"npm run server-no-build & npm run e2e-only","e2e":"npm run e2e-headless","e2e-only":"python3 -m pytest","eslint":"eslint --ext js --ext ts --fix .","format":"npm run eslint && npm run prettier & npm run yapf","prepare":"npm run clean && npm run build","prettier":"prettier --write .","rollup":"rollup -c","server":"npm run build && npm run server-no-build --","server-no-build":"node lib/cjs/bidiServer/index.js","test":"npm run build && mocha","watch":"tsc -b src/tsconfig.json --watch & rollup -c --watch","yapf":"yapf --in-place --parallel --recursive --exclude=wpt examples/ tests/"},"repository":{"type":"git","url":"git+https://github.com/GoogleChromeLabs/chromium-bidi.git"},"author":{"name":"The Chromium Authors"},"license":"Apache-2.0","peerDependencies":{"devtools-protocol":"*"},"devDependencies":{"@rollup/plugin-commonjs":"22.0.0","@rollup/plugin-node-resolve":"13.3.0","@rollup/plugin-terser":"^0.3.0","@types/argparse":"2.0.10","@types/chai":"4.3.1","@types/chai-as-promised":"7.1.5","@types/debug":"4.1.7","@types/mocha":"9.1.1","@types/node":"18.11.14","@types/sinon":"10.0.11","@types/websocket":"1.0.5","@types/ws":"8.5.3","@typescript-eslint/eslint-plugin":"5.38.0","@typescript-eslint/parser":"5.38.0","argparse":"2.0.1","chai":"4.3.6","chai-as-promised":"7.1.1","chai-exclude":"2.1.0","debug":"4.3.4","devtools-protocol":"0.0.1007249","eslint":"8.24.0","eslint-config-prettier":"8.5.0","eslint-plugin-import":"2.26.0","eslint-plugin-mocha":"10.1.0","eslint-plugin-prettier":"4.2.1","gts":"3.1.1","mocha":"10.0.0","prettier":"2.6.2","puppeteer":"19.3.0","rimraf":"3.0.2","rollup":"2.74.1","sinon":"14.0.0","terser":"5.14.2","tslib":"2.4.0","typescript":"4.7.2","websocket":"1.0.34","ws":"8.6.0","zod":"3.17.3"},"dependencies":{"mitt":"3.0.0"},"gitHead":"7693ddc884e8fc88ac9c5c6e61f3827bd6946dc0","bugs":{"url":"https://github.com/GoogleChromeLabs/chromium-bidi/issues"},"homepage":"https://github.com/GoogleChromeLabs/chromium-bidi#readme","_id":"chromium-bidi@0.4.4","_nodeVersion":"16.19.0","_npmVersion":"8.19.3","dist":{"shasum":"44f25d4fa5d2f3debc3fc3948d0657194cac4407","size":212659,"noattachment":false,"key":"/chromium-bidi/-/chromium-bidi-0.4.4.tgz","tarball":"http://name.csiicloud.com:7001/chromium-bidi/download/chromium-bidi-0.4.4.tgz"},"_npmUser":{"name":"google-wombot","email":"node-team-npm+wombot@google.com"},"directories":{},"maintainers":[{"name":"google-wombot","email":""},{"name":"mathias","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/chromium-bidi_0.4.4_1676629766224_0.08220371106925817"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-02-17T10:29:26.450Z","publish_time":1676629766450,"_cnpm_publish_time":1676629766450},"0.4.3":{"name":"chromium-bidi","version":"0.4.3","description":"An implementation of the WebDriver BiDi protocol for Chromium implemented as a JavaScript layer translating between BiDi and CDP, running inside a Chrome tab.","scripts":{"build":"tsc -b src/tsconfig.json && npm run rollup","clean":"rimraf lib","e2e-headful":"npm run server-no-build -- --headless=false & npm run e2e-only","e2e-headless":"npm run server-no-build & npm run e2e-only","e2e-only":"python3 -m pytest --rootdir=tests","e2e":"npm run e2e-headless","lint":"npm run lint:eslint","lint:prettier":"prettier --check .","lint:eslint":"eslint --ext js --ext ts .","prepare":"npm run clean && npm run build","prettier":"npm run format:prettier","format":"npm run format:eslint && npm run format:prettier && npm run yapf","format:eslint":"eslint --ext js --ext ts --fix .","format:prettier":"prettier --write .","rollup":"rollup --config configs/rollup.config.js","server-no-build":"node lib/cjs/bidiServer/index.js","server":"npm run build && npm run server-no-build --","test":"npm run build && npm run unit","unit":"cross-env TS_NODE_PROJECT='src/tsconfig.json' mocha","yapf":"yapf --in-place --parallel --recursive --verbose --exclude=wpt examples/ tests/"},"repository":{"type":"git","url":"git+https://github.com/GoogleChromeLabs/chromium-bidi.git"},"author":{"name":"The Chromium Authors"},"license":"Apache-2.0","peerDependencies":{"devtools-protocol":"*","mitt":"*"},"devDependencies":{"@rollup/plugin-commonjs":"22.0.0","@rollup/plugin-node-resolve":"13.3.0","@types/argparse":"2.0.10","@types/chai":"4.3.1","@types/chai-as-promised":"7.1.5","@types/debug":"4.1.7","@types/mocha":"9.1.1","@types/node":"18.11.14","@types/sinon":"10.0.11","@types/websocket":"1.0.5","@types/ws":"8.5.3","@typescript-eslint/eslint-plugin":"5.38.0","@typescript-eslint/parser":"5.38.0","argparse":"2.0.1","chai":"4.3.6","chai-as-promised":"7.1.1","chai-exclude":"2.1.0","cross-env":"7.0.3","debug":"4.3.4","devtools-protocol":"0.0.1007249","eslint":"8.24.0","eslint-config-prettier":"8.5.0","eslint-plugin-import":"2.26.0","eslint-plugin-mocha":"10.1.0","eslint-plugin-prettier":"4.2.1","gts":"3.1.1","mitt":"3.0.0","mocha":"10.0.0","prettier":"2.6.2","puppeteer":"19.3.0","rimraf":"3.0.2","rollup":"2.74.1","rollup-plugin-terser":"7.0.2","sinon":"14.0.0","terser":"5.14.2","tslib":"2.4.0","typescript":"4.7.2","websocket":"1.0.34","ws":"8.6.0","zod":"3.17.3"},"gitHead":"8afdc0e1f9c20627ed15f97443570d034595ab38","bugs":{"url":"https://github.com/GoogleChromeLabs/chromium-bidi/issues"},"homepage":"https://github.com/GoogleChromeLabs/chromium-bidi#readme","_id":"chromium-bidi@0.4.3","_nodeVersion":"16.18.1","_npmVersion":"8.19.2","dist":{"shasum":"40ae4a5409ef3fbeabafb29d5325f3f58cbeea12","size":206628,"noattachment":false,"key":"/chromium-bidi/-/chromium-bidi-0.4.3.tgz","tarball":"http://name.csiicloud.com:7001/chromium-bidi/download/chromium-bidi-0.4.3.tgz"},"_npmUser":{"name":"google-wombot","email":"node-team-npm+wombot@google.com"},"directories":{},"maintainers":[{"name":"google-wombot","email":""},{"name":"mathias","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/chromium-bidi_0.4.3_1670938224617_0.22134097367031047"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-12-13T13:30:37.273Z","publish_time":1670938224879,"_cnpm_publish_time":1670938224879},"0.4.2":{"name":"chromium-bidi","version":"0.4.2","description":"An implementation of the WebDriver BiDi protocol for Chromium implemented as a JavaScript layer translating between BiDi and CDP, running inside a Chrome tab.","main":"index.ts","scripts":{"unit":"cross-env TS_NODE_PROJECT='src/tsconfig.json' mocha","e2e":"npm run server-no-build & npm run e2e-only","e2e-only":"python3 -m pytest --rootdir=tests","test":"npm run unit","server":"npm run build && npm run server-no-build --","server-no-build":"node ./src/.build/bidiServer/index.js","build":"npm run prettier && npm run clean && npm run build-mapper && npm run build-server","build-mapper":"rollup --config src/bidiMapper/rollup.config.js","build-server":"tsc -b src/tsconfig.json","clean":"rimraf ./src/.build","prettier":"npx prettier --write . "},"repository":{"type":"git","url":"git+https://github.com/GoogleChromeLabs/chromium-bidi.git"},"author":{"name":"The Chromium Authors"},"license":"Apache-2.0","dependencies":{"argparse":"^2.0.1","chai-exclude":"^2.1.0","debug":"^4.3.1","puppeteer":"^13.4.0","ts-node":"^9.1.1","tslib":"^2.3.1","websocket":"^1.0.34","ws":"^7.4.5"},"devDependencies":{"@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.0.4","@rollup/plugin-typescript":"^8.2.5","@types/argparse":"^2.0.10","@types/chai":"^4.2.21","@types/chai-as-promised":"^7.1.4","@types/debug":"^4.1.6","@types/mocha":"^8.2.2","@types/sinon":"^10.0.2","@types/websocket":"^1.0.4","@types/ws":"^7.4.4","chai":"^4.3.4","chai-as-promised":"^7.1.1","cross-env":"^7.0.3","devtools-protocol":"^0.0.900357","mocha":"^9.0.1","prettier":"2.3.0","rimraf":"^3.0.2","rollup":"^2.47.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-string":"^3.0.0","sinon":"^11.1.1","typescript":"^4.3.5"},"gitHead":"b678a15ceb9a1928228618715e867421c045a139","bugs":{"url":"https://github.com/GoogleChromeLabs/chromium-bidi/issues"},"homepage":"https://github.com/GoogleChromeLabs/chromium-bidi#readme","_id":"chromium-bidi@0.4.2","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"shasum":"1ed2f155ffd27188ade14fd23bb7ac8e83f08858","size":152323,"noattachment":false,"key":"/chromium-bidi/-/chromium-bidi-0.4.2.tgz","tarball":"http://name.csiicloud.com:7001/chromium-bidi/download/chromium-bidi-0.4.2.tgz"},"_npmUser":{"name":"google-wombot","email":"node-team-npm+wombot@google.com"},"directories":{},"maintainers":[{"name":"google-wombot","email":""},{"name":"mathias","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/chromium-bidi_0.4.2_1651838291936_0.12726413434279826"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-05-06T13:42:07.105Z","publish_time":1651838292076,"_cnpm_publish_time":1651838292076},"0.1.2":{"name":"chromium-bidi","version":"0.1.2","description":"An implementation of the WebDriver BiDi protocol for Chromium implemented as a JavaScript layer translating between BiDi and CDP, running inside a Chrome tab.","main":"index.ts","scripts":{"unit":"cross-env TS_NODE_PROJECT='src/tsconfig.json' mocha","e2e":"npm run server-no-build & npm run e2e-only","e2e-only":"python3 -m pytest --rootdir=tests","test":"npm run unit","server":"npm run build && npm run server-no-build --","server-no-build":"node ./src/.build/bidiServer/index.js","build":"npm run prettier && npm run clean && npm run build-mapper && npm run build-server","build-mapper":"rollup --config src/bidiMapper/rollup.config.js","build-server":"tsc -b src/tsconfig.json","clean":"rimraf ./src/.build","prettier":"npx prettier --write . "},"repository":{"type":"git","url":"git+https://github.com/GoogleChromeLabs/chromium-bidi.git"},"author":{"name":"The Chromium Authors"},"license":"Apache-2.0","dependencies":{"argparse":"^2.0.1","chai-exclude":"^2.1.0","debug":"^4.3.1","puppeteer":"^13.4.0","ts-node":"^9.1.1","tslib":"^2.3.1","websocket":"^1.0.34","ws":"^7.4.5"},"devDependencies":{"@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.0.4","@rollup/plugin-typescript":"^8.2.5","@types/argparse":"^2.0.10","@types/chai":"^4.2.21","@types/chai-as-promised":"^7.1.4","@types/debug":"^4.1.6","@types/mocha":"^8.2.2","@types/sinon":"^10.0.2","@types/websocket":"^1.0.4","@types/ws":"^7.4.4","chai":"^4.3.4","chai-as-promised":"^7.1.1","cross-env":"^7.0.3","devtools-protocol":"^0.0.900357","mocha":"^9.0.1","prettier":"2.3.0","rimraf":"^3.0.2","rollup":"^2.47.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-string":"^3.0.0","sinon":"^11.1.1","typescript":"^4.3.5"},"gitHead":"0bbe956e36d1f792ca205f9ccb3cb04f0d9c946b","bugs":{"url":"https://github.com/GoogleChromeLabs/chromium-bidi/issues"},"homepage":"https://github.com/GoogleChromeLabs/chromium-bidi#readme","_id":"chromium-bidi@0.1.2","_nodeVersion":"14.16.1","_npmVersion":"6.14.12","dist":{"shasum":"98fd0b6c12695b9c632a643e06c39732b4f85f6a","size":154763,"noattachment":false,"key":"/chromium-bidi/-/chromium-bidi-0.1.2.tgz","tarball":"http://name.csiicloud.com:7001/chromium-bidi/download/chromium-bidi-0.1.2.tgz"},"_npmUser":{"name":"mathias","email":"mathias@qiwi.be"},"directories":{},"maintainers":[{"name":"google-wombot","email":""},{"name":"mathias","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/chromium-bidi_0.1.2_1651136193935_0.4535292033952101"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-04-28T12:00:47.328Z","publish_time":1651136194057,"_cnpm_publish_time":1651136194057},"0.0.0":{"name":"chromium-bidi","version":"0.0.0","description":"An implementation of the WebDriver BiDi protocol for Chromium implemented as a JavaScript layer translating between BiDi and CDP, running inside a Chrome tab.","main":"index.ts","scripts":{"unit":"cross-env TS_NODE_PROJECT='src/tsconfig.json' mocha","e2e":"npm run server-no-build & npm run e2e-only","e2e-only":"python3 -m pytest --rootdir=tests","server":"npm run build && npm run server-no-build --","server-no-build":"node ./src/.build/bidiServer/index.js","build":"npm run prettier && npm run clean && npm run build-mapper && npm run build-server","build-mapper":"rollup --config src/bidiMapper/rollup.config.js","build-server":"tsc -b src/tsconfig.json","clean":"rimraf ./src/.build","prettier":"npx prettier --write . "},"author":{"name":"The Chromium Authors"},"license":"Apache-2.0","dependencies":{"argparse":"^2.0.1","chai-exclude":"^2.1.0","debug":"^4.3.1","puppeteer":"^13.4.0","ts-node":"^9.1.1","tslib":"^2.3.1","websocket":"^1.0.34","ws":"^7.4.5"},"devDependencies":{"@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.0.4","@rollup/plugin-typescript":"^8.2.5","@types/argparse":"^2.0.10","@types/chai":"^4.2.21","@types/chai-as-promised":"^7.1.4","@types/debug":"^4.1.6","@types/mocha":"^8.2.2","@types/sinon":"^10.0.2","@types/websocket":"^1.0.4","@types/ws":"^7.4.4","chai":"^4.3.4","chai-as-promised":"^7.1.1","cross-env":"^7.0.3","devtools-protocol":"^0.0.900357","mocha":"^9.0.1","prettier":"2.3.0","rimraf":"^3.0.2","rollup":"^2.47.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-string":"^3.0.0","sinon":"^11.1.1","typescript":"^4.3.5"},"gitHead":"4ec096f43006b2bb28f20a6b88bf605bc65a1632","_id":"chromium-bidi@0.0.0","_nodeVersion":"14.16.1","_npmVersion":"6.14.12","dist":{"shasum":"759120653b1266f4fe8e9acb552af89c82d7de72","size":154652,"noattachment":false,"key":"/chromium-bidi/-/chromium-bidi-0.0.0.tgz","tarball":"http://name.csiicloud.com:7001/chromium-bidi/download/chromium-bidi-0.0.0.tgz"},"_npmUser":{"name":"mathias","email":"mathias@qiwi.be"},"directories":{},"maintainers":[{"name":"google-wombot","email":""},{"name":"mathias","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/chromium-bidi_0.0.0_1651133104030_0.9743513318018282"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-04-28T12:00:46.044Z","publish_time":1651133104228,"_cnpm_publish_time":1651133104228}},"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 (chromedriver)](https://github.com/GoogleChromeLabs/chromium-bidi/actions/workflows/wpt-chromedriver.yml/badge.svg)\n![WPT Tests (mapper)](https://github.com/GoogleChromeLabs/chromium-bidi/actions/workflows/wpt-mapper.yml/badge.svg)\n\n![Generate WPT Report](https://github.com/GoogleChromeLabs/chromium-bidi/actions/workflows/generate-wpt-report.yml/badge.svg)\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## 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 `cdp.sendCommand`\n\n```cddl\nCdpSendCommandCommand = {\n  method: \"cdp.sendCommand\",\n  params: ScriptEvaluateParameters,\n}\n\nCdpSendCommandParameters = {\n   cdpMethod: text,\n   cdpParams: any,\n   cdpSession?: text,\n}\n\nCdpSendCommandResult = {\n   result: any,\n   cdpSession: text,\n}\n```\n\nThe command runs the\ndescribed [CDP command](https://chromedevtools.github.io/devtools-protocol)\nand returns result.\n\n### Command `cdp.getSession`\n\n```cddl\nCdpGetSessionCommand = {\n   method: \"cdp.sendCommand\",\n   params: ScriptEvaluateParameters,\n}\n\nCdpGetSessionParameters = {\n   context: BrowsingContext,\n}\n\nCdpGetSessionResult = {\n   cdpSession: text,\n}\n```\n\nThe command returns the default CDP session for the selected browsing context.\n\n### Event `cdp.eventReceived`\n\n```cddl\nCdpEventReceivedEvent = {\n   method: \"cdp.eventReceived\",\n   params: ScriptEvaluateParameters,\n}\n\nCdpEventReceivedParameters = {\n   cdpMethod: text,\n   cdpParams: any,\n   cdpSession: string,\n}\n```\n\nThe event contains a CDP event.\n\n### Field `channel`\n\nEach command can be extended with a `channel`:\n\n```cddl\nCommand = {\n   id: js-uint,\n   channel?: text,\n   CommandData,\n   Extensible,\n}\n```\n\nIf provided and non-empty string, the very same `channel` is added to the response:\n\n```cddl\nCommandResponse = {\n   id: js-uint,\n   channel?: text,\n   result: ResultData,\n   Extensible,\n}\n\nErrorResponse = {\n  id: js-uint / null,\n  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 `channel`, the subscriptions are handled per channel, and the corresponding\n`channel` filed is added to the event message:\n\n```cddl\nEvent = {\n  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### pre-commit.com integration\n\nRefer to the documentation at [.pre-commit-config.yaml](.pre-commit-config.yaml).\n\n### Starting the 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 CLI argument `--headless=false` to run browser in headful mode:\n\n```sh\nnpm run server -- --headless=false\n```\n\nUse the `CHANNEL=...` environment variable or `--channel=...` argument with one of\nthe following values to run the specific Chrome channel: `chrome`,\n`chrome-beta`, `chrome-canary`, `chrome-dev`.\n\nThe requested Chrome version should be installed.\n\n```sh\nCHANNEL=chrome-dev npm run server\nnpm run server -- --channel=chrome-dev\n```\n\n### Starting on Linux and Mac\n\nTODO: verify if it works on Windows.\n\nYou can also run the server by using script `./runBiDiServer.sh`. It will write\noutput to the file `log.txt`:\n\n```sh\n./runBiDiServer.sh --port=8081 --headless=false\n```\n\n## Running\n\n### Unit tests\n\nRunning:\n\n```sh\nnpm test\n```\n\n### E2E tests\n\nThe E2E tests are written using Python, in order to learn how to eventually do\nthis in web-platform-tests.\n\n### Installation\n\nPython 3.6+ and some dependencies are required:\n\n```sh\npython3 -m pip install --user -r tests/requirements.txt\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\n```\n\nUse the `PORT` environment variable to connect to another port:\n\n```sh\nPORT=8081 npm run e2e\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 `WPT_BROWSER_PATH`\n\nSet the `WPT_BROWSER_PATH` environment variable to a Chrome, Edge or Chromium binary to launch.\nFor example, on macOS:\n\n```sh\n# Chrome\nexport WPT_BROWSER_PATH=\"/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary\"\nexport WPT_BROWSER_PATH=\"/Applications/Google Chrome Dev.app/Contents/MacOS/Google Chrome Dev\"\nexport WPT_BROWSER_PATH=\"/Applications/Google Chrome Beta.app/Contents/MacOS/Google Chrome Beta\"\nexport WPT_BROWSER_PATH=\"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\"\nexport WPT_BROWSER_PATH=\"/Applications/Chromium.app/Contents/MacOS/Chromium\"\n\n# Edge\nexport WPT_BROWSER_PATH=\"/Applications/Microsoft Edge Canary.app/Contents/MacOS/Microsoft Edge Canary\"\nexport WPT_BROWSER_PATH=\"/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 watch\n```\n\n#### 3. Run\n\n```sh\n./wpt/wpt run \\\n  --webdriver-binary runBiDiServer.sh \\\n  --binary \"$WPT_BROWSER_PATH\" \\\n  --manifest wpt/MANIFEST.json \\\n  --metadata wpt-metadata/mapper/headless \\\n  chromium \\\n  webdriver/tests/bidi/\n```\n\n### Update WPT expectations if needed\n\n#### 1. Run WPT tests with custom `log-wptreport`:\n\n```sh\n./wpt/wpt run \\\n  --webdriver-binary runBiDiServer.sh \\\n  --binary \"$WPT_BROWSER_PATH\" \\\n  --manifest wpt/MANIFEST.json \\\n  --metadata wpt-metadata/mapper/headless \\\n  --log-wptreport wptreport.json \\\n  chromium \\\n  webdriver/tests/bidi/\n```\n\n#### 2. Update expectations based on the previous test run:\n\n```sh\n./wpt/wpt update-expectations \\\n  --product chromium \\\n  --manifest wpt/MANIFEST.json \\\n  --metadata wpt-metadata/mapper/headless \\\n  wptreport.json\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\n1. Open a PR bumping the chromium-bidi version number in `package.json` for review:\n\n   ```sh\n   npm version patch -m '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","_attachments":{},"homepage":"https://github.com/GoogleChromeLabs/chromium-bidi#readme","bugs":{"url":"https://github.com/GoogleChromeLabs/chromium-bidi/issues"},"license":"Apache-2.0"}