{"name":"win-detect-browsers","version":"8.0.2","keywords":["browser","browsers","detect","windows","chrome","chromium","canary","firefox","ie","internet-explorer","safari","opera","maxthon","yandex"],"author":{"name":"Vincent Weevers"},"license":"MIT","_id":"win-detect-browsers@8.0.2","maintainers":[{"name":"vweevers","email":"dev@vincentweevers.nl"}],"homepage":"https://github.com/vweevers/win-detect-browsers","bugs":{"url":"https://github.com/vweevers/win-detect-browsers/issues"},"bin":{"win-detect-browsers":"cli.js"},"dist":{"shasum":"339e93e8b7463a4e085decab03ef825b98eed86f","tarball":"http://registry-npm.ywwl.com/win-detect-browsers/download/win-detect-browsers-8.0.2.tgz","fileCount":14,"integrity":"sha512-Sc+1D86fty1Z1tdxK7M2oXWfGX+rfyBLbStDDgYdkeb80a0iXJSTX3GXql3PLXN/xH0gfzAueQ+HmXwKafCP4Q==","signatures":[{"sig":"MEUCIQC4+cf1wxve+cX6ooQLpAEsMMEJTNVY4ycObVi7UP9NDgIgE07keGjq6jh8HiknZdb+wUI8CU4/ePgOIm909J+P9Nw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/win-detect-browsers@8.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":47504,"size":13823,"noattachment":false,"key":"/win-detect-browsers/-/win-detect-browsers-8.0.2.tgz"},"main":"index.js","type":"module","engines":{"node":">=20"},"gitHead":"167019428b21b7ac3c529008ce45ae86dfffe35b","scripts":{"test":"standard && hallmark && node test.js","hallmark":"hallmark --fix"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:336e777e-b60c-4fc0-b628-906ab4880d55"}},"repository":{"url":"git+https://github.com/vweevers/win-detect-browsers.git","type":"git"},"_npmVersion":"11.6.1","description":"Fast and native browser detection on Windows","directories":{},"_nodeVersion":"24.11.0","dependencies":{"after":"^0.8.2","debug":"^4.1.0","which":"^5.0.0","yargs":"^18.0.0","existent":"^1.0.1","registry-js":"^1.9.0","windows-env":"^1.0.1","pe-machine-type":"^1.0.0","win-version-info":"^6.0.1"},"_hasShrinkwrap":false,"devDependencies":{"tape":"^5.0.0","hallmark":"^5.0.1","standard":"^17.0.0","win-dummy-exe":"0.0.1"},"_npmOperationalInternal":{"tmp":"tmp/win-detect-browsers_8.0.2_1763144975876_0.006210956174174331","host":"s3://npm-registry-packages-npm-production"},"readme":"# win-detect-browsers\r\n\r\n**Fast and native browser detection on Windows. Detects installed versions of [Beaker](https://beakerbrowser.com/), [Brave](https://brave.com/), [Chrome](https://www.google.com/chrome/), [Chromium](https://www.chromium.org/), [Firefox](https://www.mozilla.org/en-US/firefox/), [Internet Explorer](https://en.wikipedia.org/wiki/Internet_Explorer), [Maxthon](http://www.maxthon.com/), [Opera](https://www.opera.com/), [Safari](https://www.apple.com/safari/) and [Yandex](https://browser.yandex.com/).**\r\n\r\n[![npm](https://img.shields.io/npm/v/win-detect-browsers.svg)](https://www.npmjs.com/package/win-detect-browsers)\r\n[![Node version](https://img.shields.io/node/v/win-detect-browsers.svg)](https://www.npmjs.com/package/win-detect-browsers)\r\n[![Test](https://img.shields.io/github/actions/workflow/status/vweevers/win-detect-browsers/test.yml?branch=master\\&label=test)](https://github.com/vweevers/win-detect-browsers/actions/workflows/test.yml)\r\n[![Standard](https://img.shields.io/badge/standard-informational?logo=javascript&logoColor=fff)](https://standardjs.com)\r\n[![Common Changelog](https://common-changelog.org/badge.svg)](https://common-changelog.org)\r\n\r\n## Usage\r\n\r\n_If you are upgrading: please see the [changelog](CHANGELOG.md)._\r\n\r\n```js\r\nimport detect from 'win-detect-browsers'\r\n\r\n// All browsers\r\nconst browsers = await detect()\r\n\r\n// Search only for Chrome and Firefox\r\nconst browsers = await detect(['chrome', 'firefox'])\r\n\r\nfor (const b of browsers) {\r\n  console.log(b.version) // E.g. '57.0.2931.0'\r\n  console.log(b.channel) // E.g. 'canary'\r\n}\r\n```\r\n\r\n## API\r\n\r\n### `detect([names])`\r\n\r\n`names` is an array of browser names you want to find. If omitted or empty, it will detect _[everything](http://youtu.be/k1yvvNvlXtg)_. Returns a promise for an array of results. A result is excluded if its path has no `.exe` extension or if its version could not be read.\r\n\r\nEach result is an object with the following properties:\r\n\r\n- `name` (string): `chrome`, `chromium`, `firefox`, `beaker`, `brave`, `ie`, `msedge`, `maxthon`, `opera`, `safari`, `yandex`\r\n- `path` (string): absolute path to executable\r\n- `version` (string)\r\n- `arch` (string): CPU type the executable was built for: `amd64`, `i386` or [other](https://github.com/vweevers/pe-machine-type#types);\r\n- `info` (object): executable metadata (see [sample](#sample) below).\r\n\r\nAdditional properties are usually available but not guaranteed:\r\n\r\n- `channel` (string):\r\n  - Chrome: `stable`, `canary`, `beta` or `dev`\r\n  - Firefox: `release`, `developer`, `nightly` or [`esr`](https://www.mozilla.org/en-US/firefox/organizations/faq/)\r\n  - Older versions of Firefox: `aurora`, `beta` or `rc`;\r\n  - Opera: `stable`, `beta` or `developer`.\r\n  - Edge: `stable`, `beta` or `dev`\r\n\r\n## CLI\r\n\r\n```\r\nwin-detect-browsers [options] [name, name..]\r\n```\r\n\r\nWrite browsers to stdout as a JSON array. Includes all browsers unless one or more names are given (see list above).\r\n\r\nOptions:\r\n\r\n- `--help` `-h`: Show help\r\n- `--version` `-v`: Show CLI version number\r\n- `--summary` `-s`: Less properties;\r\n- `--debug` `-d`: Enable debug output.\r\n\r\n### Sample\r\n\r\nOn Windows 10:\r\n\r\n<details><summary>Click to expand</summary>\r\n\r\n```json\r\n[\r\n  {\r\n    \"name\": \"ie\",\r\n    \"path\": \"C:\\\\Program Files\\\\Internet Explorer\\\\iexplore.exe\",\r\n    \"version\": \"11.0.17134.1\",\r\n    \"arch\": \"amd64\",\r\n    \"info\": {\r\n      \"FileVersion\": \"11.0.17134.1\",\r\n      \"CompanyName\": \"Microsoft Corporation\",\r\n      \"FileDescription\": \"Internet Explorer\",\r\n      \"InternalName\": \"iexplore\",\r\n      \"LegalCopyright\": \"© Microsoft Corporation. Alle rechten voorbehouden.\",\r\n      \"OriginalFilename\": \"IEXPLORE.EXE.MUI\",\r\n      \"ProductName\": \"Internet Explorer\",\r\n      \"ProductVersion\": \"11.00.17134.1\"\r\n    }\r\n  },\r\n  {\r\n    \"name\": \"ie\",\r\n    \"path\": \"C:\\\\Program Files (x86)\\\\Internet Explorer\\\\iexplore.exe\",\r\n    \"version\": \"11.0.17134.1\",\r\n    \"arch\": \"i386\",\r\n    \"info\": {\r\n      \"FileVersion\": \"11.0.17134.1\",\r\n      \"CompanyName\": \"Microsoft Corporation\",\r\n      \"FileDescription\": \"Internet Explorer\",\r\n      \"InternalName\": \"iexplore\",\r\n      \"LegalCopyright\": \"© Microsoft Corporation. Alle rechten voorbehouden.\",\r\n      \"OriginalFilename\": \"IEXPLORE.EXE.MUI\",\r\n      \"ProductName\": \"Internet Explorer\",\r\n      \"ProductVersion\": \"11.00.17134.1\"\r\n    }\r\n  },\r\n  {\r\n    \"name\": \"firefox\",\r\n    \"path\": \"C:\\\\Program Files\\\\Mozilla Firefox\\\\firefox.exe\",\r\n    \"version\": \"61.0.0.6711\",\r\n    \"channel\": \"release\",\r\n    \"arch\": \"amd64\",\r\n    \"info\": {\r\n      \"FileVersion\": \"61.0.0.6711\",\r\n      \"LegalCopyright\": \"©Firefox and Mozilla Developers; available under the MPL 2 license.\",\r\n      \"CompanyName\": \"Mozilla Corporation\",\r\n      \"FileDescription\": \"Firefox\",\r\n      \"ProductVersion\": \"61.0\",\r\n      \"InternalName\": \"Firefox\",\r\n      \"LegalTrademarks\": \"Firefox is a Trademark of The Mozilla Foundation.\",\r\n      \"OriginalFilename\": \"../../dist/bin/firefox.exe\",\r\n      \"ProductName\": \"Firefox\",\r\n      \"BuildID\": \"20180517141400\"\r\n    }\r\n  },\r\n  {\r\n    \"name\": \"firefox\",\r\n    \"path\": \"C:\\\\Program Files\\\\Firefox Developer Edition\\\\firefox.exe\",\r\n    \"version\": \"61.0.0.6711\",\r\n    \"channel\": \"developer\",\r\n    \"arch\": \"amd64\",\r\n    \"info\": {\r\n      \"FileVersion\": \"61.0.0.6711\",\r\n      \"LegalCopyright\": \"©Firefox and Mozilla Developers; available under the MPL 2 license.\",\r\n      \"CompanyName\": \"Mozilla Corporation\",\r\n      \"FileDescription\": \"Firefox Developer Edition\",\r\n      \"ProductVersion\": \"61.0\",\r\n      \"InternalName\": \"Firefox Developer Edition\",\r\n      \"LegalTrademarks\": \"Firefox is a Trademark of The Mozilla Foundation.\",\r\n      \"OriginalFilename\": \"../../dist/bin/firefox.exe\",\r\n      \"ProductName\": \"Firefox Developer Edition\",\r\n      \"BuildID\": \"20180517141400\"\r\n    }\r\n  },\r\n  {\r\n    \"name\": \"firefox\",\r\n    \"path\": \"C:\\\\Program Files\\\\Firefox Nightly\\\\firefox.exe\",\r\n    \"version\": \"62.0.0.6712\",\r\n    \"channel\": \"nightly\",\r\n    \"arch\": \"amd64\",\r\n    \"info\": {\r\n      \"FileVersion\": \"62.0.0.6712\",\r\n      \"LegalCopyright\": \"©Firefox and Mozilla Developers; available under the MPL 2 license.\",\r\n      \"CompanyName\": \"Mozilla Corporation\",\r\n      \"FileDescription\": \"Firefox Nightly\",\r\n      \"ProductVersion\": \"62.0a1\",\r\n      \"InternalName\": \"Firefox Nightly\",\r\n      \"LegalTrademarks\": \"Firefox is a Trademark of The Mozilla Foundation.\",\r\n      \"OriginalFilename\": \"firefox.exe\",\r\n      \"ProductName\": \"Firefox Nightly\",\r\n      \"BuildID\": \"20180518222751\"\r\n    }\r\n  },\r\n  {\r\n    \"name\": \"chrome\",\r\n    \"path\": \"C:\\\\Users\\\\vweevers\\\\AppData\\\\Local\\\\Google\\\\Chrome SxS\\\\Application\\\\chrome.exe\",\r\n    \"version\": \"68.0.3436.0\",\r\n    \"channel\": \"canary\",\r\n    \"arch\": \"amd64\",\r\n    \"info\": {\r\n      \"FileVersion\": \"68.0.3436.0\",\r\n      \"CompanyName\": \"Google Inc.\",\r\n      \"FileDescription\": \"Google Chrome\",\r\n      \"InternalName\": \"chrome_exe\",\r\n      \"LegalCopyright\": \"Copyright 2017 Google Inc. All rights reserved.\",\r\n      \"OriginalFilename\": \"chrome.exe\",\r\n      \"ProductName\": \"Google Chrome\",\r\n      \"ProductVersion\": \"68.0.3436.0\",\r\n      \"CompanyShortName\": \"Google\",\r\n      \"ProductShortName\": \"Chrome\",\r\n      \"LastChange\": \"e0f81fe637f233bf12e821915b72bc8d2194c3f2-refs/branch-heads/3436@{#1}\",\r\n      \"Official Build\": \"1\"\r\n    }\r\n  },\r\n  {\r\n    \"name\": \"chrome\",\r\n    \"path\": \"C:\\\\Program Files (x86)\\\\Google\\\\Chrome\\\\Application\\\\chrome.exe\",\r\n    \"version\": \"66.0.3359.181\",\r\n    \"channel\": \"stable\",\r\n    \"arch\": \"amd64\",\r\n    \"info\": {\r\n      \"FileVersion\": \"66.0.3359.181\",\r\n      \"CompanyName\": \"Google Inc.\",\r\n      \"FileDescription\": \"Google Chrome\",\r\n      \"InternalName\": \"chrome_exe\",\r\n      \"LegalCopyright\": \"Copyright 2017 Google Inc. All rights reserved.\",\r\n      \"OriginalFilename\": \"chrome.exe\",\r\n      \"ProductName\": \"Google Chrome\",\r\n      \"ProductVersion\": \"66.0.3359.181\",\r\n      \"CompanyShortName\": \"Google\",\r\n      \"ProductShortName\": \"Chrome\",\r\n      \"LastChange\": \"a10b9cedb40738cb152f8148ddab4891df876959-refs/branch-heads/3359@{#828}\",\r\n      \"Official Build\": \"1\"\r\n    }\r\n  },\r\n  {\r\n    \"name\": \"opera\",\r\n    \"path\": \"C:\\\\Program Files\\\\Opera beta\\\\Launcher.exe\",\r\n    \"version\": \"53.0.2907.31\",\r\n    \"channel\": \"beta\",\r\n    \"arch\": \"amd64\",\r\n    \"info\": {\r\n      \"FileVersion\": \"53.0.2907.31\",\r\n      \"LegalCopyright\": \"Copyright Opera Software 2018\",\r\n      \"InternalName\": \"Opera\",\r\n      \"CompanyName\": \"Opera Software\",\r\n      \"ProductName\": \"Opera beta Internet Browser\",\r\n      \"ProductVersion\": \"53.0.2907.31\",\r\n      \"FileDescription\": \"Opera beta Internet Browser\"\r\n    }\r\n  }\r\n]\r\n```\r\n\r\n</details>\r\n\r\n## Install\r\n\r\nWith [npm](https://npmjs.org) do:\r\n\r\n```bash\r\nnpm install win-detect-browsers     # For API\r\nnpm install win-detect-browsers -g  # For CLI\r\n```\r\n\r\n## Background\r\n\r\nBrowser detection on Windows can't be done right. This is the _try-everything-and-fail-silently_ approach. It accounts for architecture differences, normalizes environment variables, tries default locations, searches the registry (in the HKLM and HKCU hives as well as WoW counterparts) (including [Start Menu Internet Applications](http://msdn.microsoft.com/en-us/library/windows/desktop/dd203067(v=vs.85).aspx), Google Updater and more), and looks in `PATH`. Version numbers are then read from the executable metadata.\r\n\r\n`browser-launcher` by substack has [poor Windows support](https://github.com/substack/browser-launcher/issues/7), and it prompted me to create this module. It is now used in [browser-launcher2](https://github.com/benderjs/browser-launcher2), ~~an active~~ a once active fork of `browser-launcher`.\r\n\r\n## License\r\n\r\n[MIT](./LICENSE)\r\n","publish_time":1763144976066,"_cnpm_publish_time":1763144976066,"dist-tags":{"latest":"8.0.3","next":"3.0.0-rc1"}}