{"_id":"geckodriver@8.0.0","bin":{"geckodriver":"bin/geckodriver.js"},"bugs":{"url":"https://github.com/webdriverio/driver/issues"},"dist":{"shasum":"2691f270c43a8dbfbb6f42aad7a916371f3ac2ec","tarball":"http://registry-npm.ywwl.com/geckodriver/download/geckodriver-8.0.0.tgz","fileCount":46,"integrity":"sha512-2jGCA6deI5MAjODxmHljPqvaUccGbeeqMUHXlW4k3FNDp4YDpxSI+P5QG+w5KIsnCeuGEfTTNi2euKqHI1eD6Q==","signatures":[{"sig":"MEUCIQCtjX3kPjbL/5uNWOGH3fExm0eOlp+Bf6X1iy2bLwV2hAIgazUAJIXiuTsgiegD8xzTP7l2hkjuGzG/giAig8wIQ5E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQClXYTXE0bfA6o2WAsKmzRKHs8Dff7dzE31ZANBhpuGOQIgD9WTV+HzWorEUI5hVyTDAFKeeqqnKnytD5xFvn5io2A="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/geckodriver@8.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":69896,"size":20677,"noattachment":false,"key":"/geckodriver/-/geckodriver-8.0.0.tgz"},"main":"./dist/cjs/index.js","name":"geckodriver","type":"module","types":"./dist/cjs/index.d.ts","author":{"url":"http://vf.io","name":"vladikoff","email":"vlad.filippov@gmail.com"},"engines":{"node":">=22.19.0"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index.js"}}},"gitHead":"b598c1d04bfcc404396377a75176973f03233077","license":"MIT","scripts":{"test":"run-s build test:*","build":"tsc -b . && node ../../scripts/copy-cjs-pkg.mjs","clean":"rimraf ./dist ./tsconfig.tsbuildinfo","watch":"pnpm run build -- --watch","test:lint":"oxlint .","test:unit":"vitest --run --coverage","check:pack":"node ../../scripts/check-pack.mjs && publint && attw --pack .","postinstall":"node -e \"if (require('fs').existsSync('./dist/install.js')) { process.exit(1) } console.log('Skipping install, project not built!')\" || node ./dist/install.js || echo Skipping install, the driver download failed.","test:typecheck":"tsc -p tsconfig.test.json"},"version":"8.0.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"acd523ef-8935-4b10-9360-269a45c226b1"}},"homepage":"https://github.com/webdriverio/driver/tree/main/packages/node-geckodriver#readme","keywords":["geckodriver","webdriver"],"repository":{"url":"git+https://github.com/webdriverio/driver.git","type":"git","directory":"packages/node-geckodriver"},"_npmVersion":"12.2.0","description":"Mozilla's Geckodriver for Node.js","directories":{},"maintainers":[{"name":"wdio-user","email":"bot@webdriver.io"}],"_nodeVersion":"24.21.0","contributors":[{"url":"https://bromann.dev","name":"Christian Bromann","email":"mail@bromann.dev"}],"dependencies":{"undici":"^8.11.2","decamelize":"^6.0.1","modern-tar":"^0.8.5","@zip.js/zip.js":"^2.23.0"},"_hasShrinkwrap":false,"devDependencies":{"@wdio/logger":"^10.0.0"},"peerDependencies":{"@wdio/logger":"^9.18.0 || ^10.0.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/geckodriver_8.0.0_1791578874593_0.47718672746070245"},"readme":"Geckodriver [![CI](https://github.com/webdriverio/driver/actions/workflows/ci.yml/badge.svg)](https://github.com/webdriverio/driver/actions/workflows/ci.yml) [![Audit](https://github.com/webdriverio/driver/actions/workflows/audit.yml/badge.svg)](https://github.com/webdriverio/driver/actions/workflows/audit.yml)\n==========\n\nAn npm wrapper for Mozilla's [Geckodriver](https://github.com/mozilla/geckodriver). It manages to download various (or the latest) Geckodriver versions and provides a programmatic interface to start and stop it within Node.js. __Note:__ this is a wrapper module. If you discover any bugs with Geckodriver, please report them in the [official repository](https://github.com/mozilla/geckodriver).\n\n__Requirements:__ Node.js 22.19.0 or newer. With Yarn and without WebdriverIO, also install `@wdio/logger`. See [Compatibility](https://github.com/webdriverio/driver#compatibility).\n\n# Installing\n\nYou can install this package via:\n\n```sh\nnpm install geckodriver\n```\n\nOr install it globally:\n\n```sh\nnpm install -g geckodriver\n```\n\n__Note:__ This installs a `geckodriver` shell script that runs the executable, but on Windows, [`selenium-webdriver`](https://www.npmjs.com/package/selenium-webdriver) looks for `geckodriver.exe`. The package downloads the binary into its cache folder (`GECKODRIVER_CACHE_DIR`, by default the system temporary folder) as `geckodriver-<version>.exe`, not into the package folder. Set the cache folder and the version, run the driver once, then copy the binary to a folder on your `PATH` (such as the npm bin directory):\n\n```cmd\nset GECKODRIVER_CACHE_DIR=%USERPROFILE%\\geckodriver\nset GECKODRIVER_VERSION=0.37.1\ngeckodriver --version\ncopy /Y %GECKODRIVER_CACHE_DIR%\\geckodriver-%GECKODRIVER_VERSION%.exe %APPDATA%\\npm\\geckodriver.exe\n```\n\nName the exact version: with a wildcard, `copy` joins all cached versions into one broken file.\n\nOnce installed you can start Geckodriver via:\n\n```sh\nnpx geckodriver --port=4444\n```\n\nBy default, this package downloads Geckodriver when used for the first time through the CLI or the programmatic interface. If you like to download it as part of the npm install process, set the `GECKODRIVER_AUTO_INSTALL` environment flag, e.g.:\n\n```sh\nGECKODRIVER_AUTO_INSTALL=1 npm i\n```\n\nThe download runs in the package's `postinstall` script. pnpm 10 or newer and Bun run it only for a package you approve (`pnpm approve-builds`, or `trustedDependencies` in Bun), and recent npm versions warn until you approve it with `npm install-scripts approve geckodriver`. If the download fails, the install does not fail: the driver then downloads on first use.\n\nTo get a list of available CLI options run `npx geckodriver --help`. By default, this package downloads the latest version of the driver. If you prefer to have it install a custom Geckodriver version you can define the environment variable `GECKODRIVER_VERSION` when running in CLI, e.g.:\n\n```sh\n$ npm i geckodriver\n$ GECKODRIVER_VERSION=\"0.31.0\" npx geckodriver --version\ngeckodriver 0.31.0 (b617178ef491 2022-04-06 11:57 +0000)\n\nThe source code of this program is available from\ntesting/geckodriver in https://hg.mozilla.org/mozilla-central.\n\nThis program is subject to the terms of the Mozilla Public License 2.0.\nYou can obtain a copy of the license at https://mozilla.org/MPL/2.0/.\n```\n\n## Setting a CDN URL for binary download\n\nTo set an alternate CDN location for Geckodriver binaries, set the `GECKODRIVER_CDNURL` like this:\n\n```sh\nGECKODRIVER_CDNURL=https://INTERNAL_CDN/geckodriver/download\n```\n\nBinaries on your CDN should be located in a subdirectory of the above base URL. For example, `/vxx.xx.xx/*.tar.gz` should be located under `/geckodriver/download` above.\n\nAlternatively, add it to your [`.npmrc`](https://docs.npmjs.com/cli/configuring-npm/npmrc) file:\n\n```\ngeckodriver_cdnurl=https://INTERNAL_CDN/geckodriver/download\n```\n\nThe default location is set to https://github.com/mozilla/geckodriver/releases/download\n\nA CDN URL can carry credentials, for example `https://user:password@INTERNAL_CDN`: they are sent as a Basic `Authorization` header and kept out of the logs. Percent-encode special characters in them (`@` is `%40`, `%` is `%25`). Use an `https://` URL: over `http://`, Basic credentials travel in clear text. A redirect to another host does not receive them.\n\n## Setting a PROXY URL\n\nUse `HTTPS_PROXY` or `HTTP_PROXY` to set your proxy URL, and `NO_PROXY` for the hosts that skip it. The lower-case forms (`https_proxy`, `http_proxy`, `no_proxy`) work too and win over the upper-case ones. A dispatcher set with undici's `setGlobalDispatcher` (as in the [WebdriverIO proxy docs](https://webdriver.io/docs/proxy)) wins over these variables.\n\n# Programmatic Interface\n\nYou can import this package with Node.js and start the driver as part of your script and use it e.g. with [WebdriverIO](https://webdriver.io).\n\n## Exported Methods\n\nThe package exports a `start` and `download` method.\n\n### `start`\n\nStarts a Geckodriver instance and returns a [`ChildProcess`](https://nodejs.org/api/child_process.html#class-childprocess). If Geckodriver is not downloaded it will download it for you.\n\nThe driver writes logs to its `stdout` and `stderr`. Read them, or pass `spawnOpts: { stdio: 'ignore' }`: an unread pipe fills up and then blocks the driver.\n\n__Params:__ `GeckodriverParameters` - options to pass into Geckodriver (see below)\n\n__Example:__\n\n```js\nimport { start } from 'geckodriver';\nimport { remote } from 'webdriverio';\nimport waitPort from 'wait-port';\n\n/**\n * first start Geckodriver\n */\nconst cp = await start({ port: 4444 });\n\n/**\n * wait for Geckodriver to be up\n */\nawait waitPort({ port: 4444 });\n\n/**\n * then start WebdriverIO session on that port: without `port`, WebdriverIO starts a driver of its own.\n * Geckodriver accepts `127.0.0.1` but not `localhost` (the default) unless you pass `allowHosts`.\n */\nconst browser = await remote({ hostname: '127.0.0.1', port: 4444, capabilities: { browserName: 'firefox' } });\nawait browser.url('https://webdriver.io');\nconsole.log(await browser.getTitle()); // prints \"WebdriverIO · Next-gen browser and mobile automation test framework for Node.js | WebdriverIO\"\n\n/**\n * kill Geckodriver process\n */\ncp.kill();\n```\n\n__Note:__ as you can see in the example above this package does not wait for the driver to be up, you have to manage this yourself through packages like [`wait-port`](https://github.com/dwmkerr/wait-port).\n\n### `download`\n\nMethod to download a Geckodriver with a particular version. If a version parameter is omitted it tries to download the latest available version of the driver.\n\n__Params:__ `string` - version of Geckodriver to download (optional)\n\n## CJS Support\n\nIn case your module uses CJS you can use this package as follows:\n\n```js\nconst { start } = require('geckodriver')\n// see example above\n```\n\n## Options\n\nThe `start` method offers the following options to be passed on to the actual Geckodriver CLI.\n\n### `allowHosts`\n\nList of host names to allow. By default, the value of --host is allowed, and in addition, if that's a well-known local address, other variations on well-known local addresses are allowed. If --allow-hosts is provided only exactly those hosts are allowed.\n\nType: `string[]`<br />\nDefault: `[]`\n\n### `allowOrigins`\nList of request origins to allow. These must be formatted as `scheme://host:port`. By default, any request with an origin header is rejected. If `--allow-origins` is provided then only exactly those origins are allowed.\n\nType: `string[]`<br />\nDefault: `[]`\n\n### `binary`\nPath to the Firefox binary.\n\nType: `string`\n\n### `connectExisting`\nConnect to an existing Firefox instance.\n\nType: `boolean`<br />\nDefault: `false`\n\n### `host`\nHost IP to use for WebDriver server.\n\nType: `string`<br />\nDefault: `0.0.0.0`\n\n### `jsdebugger`\nAttach browser toolbox debugger for Firefox.\n\nType: `boolean`<br />\nDefault: `false`\n\n### `log`\nSet Gecko log level [possible values: `fatal`, `error`, `warn`, `info`, `config`, `debug`, `trace`].\n\nType: `string`\n\n### `logNoTruncate`\nLog verbosely and don't truncate long strings so that the log can be replayed.\n\nType: `boolean`\n\n### `marionetteHost`\nHost to use to connect to Gecko.\n\nType: `string`<br />\nDefault: `127.0.0.1`\n\n### `marionettePort`\nPort to use to connect to Gecko.\n\nType: `number`<br />\nDefault: `0`\n\n### `port`\nPort to listen on.\n\nType: `number`\n\n### `websocketPort`\nPort to use for Debugger / WebDriver BiDi. If omitted and `connectExisting` is not set, it defaults to `0` (a random available port) rather than Geckodriver's native default, so that parallel instances don't collide. Setting `websocketPort` together with `connectExisting: true` throws an error, since the two options can't be used together.\n\nType: `number`\n\n### `profileRoot`\nDirectory in which to create profiles. Defaults to the system temporary directory.\n\nType: `string`\n\n### `geckoDriverVersion`\nA version of Geckodriver to start. See https://github.com/mozilla/geckodriver/releases for all available versions, platforms and architecture.\n\nType: `string`\n\n### `customGeckoDriverPath`\nDon't download Geckodriver, instead use a custom path to it, e.g. a cached binary.\n\nType: `string`<br />\nDefault: `process.env.GECKODRIVER_PATH`\n\n### `cacheDir`\nThe path to the root of the cache directory.\n\nType: `string`<br />\nDefault: `process.env.GECKODRIVER_CACHE_DIR || os.tmpdir()`\n\n### `spawnOpts`\nOptions to pass into the geckodriver process. This can be useful if needing\nFirefox to spawn with `MOZ_` prefix variables, such as `MOZ_HEADLESS_WIDTH`.\nSee https://nodejs.org/api/child_process.html#child_processspawncommand-args-options for\nall options. Pass `{ stdio: 'ignore' }` if you don't read the driver output.\n\nType: `SpawnOptions`<br />\nDefault: `undefined`\n\n# Other Browser Driver\n\nIf you also look for other browser driver npm wrappers, you can find them here:\n\n- Chrome: [giggio/node-chromedriver](https://github.com/giggio/node-chromedriver)\n- Microsoft Edge: [webdriverio/driver - node-edgedriver](https://github.com/webdriverio/driver/tree/main/packages/node-edgedriver)\n- Safari: [webdriverio/driver - node-safaridriver](https://github.com/webdriverio/driver/tree/main/packages/node-safaridriver)\n\n---\n\nFor more information on WebdriverIO see the [homepage](https://webdriver.io).\n","publish_time":1791578874694,"_cnpm_publish_time":1791578874694,"dist-tags":{"latest":"8.0.0"}}