{"id":21184397,"url":"https://github.com/yankouskia/get-browser","last_synced_at":"2025-06-18T13:42:09.425Z","repository":{"id":47419526,"uuid":"187714321","full_name":"yankouskia/get-browser","owner":"yankouskia","description":"💻 Lightweight tool to identify the browser (mobile+desktop detection)📱","archived":false,"fork":false,"pushed_at":"2023-01-03T22:26:09.000Z","size":4627,"stargazers_count":43,"open_issues_count":13,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-05-20T10:18:39.618Z","etag":null,"topics":["browser-detection","device-detection","javascript","lightweight"],"latest_commit_sha":null,"homepage":"https://yankouskia.github.io/get-browser/example/index.html","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yankouskia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-20T21:14:35.000Z","updated_at":"2024-11-27T18:32:41.000Z","dependencies_parsed_at":"2023-02-01T11:15:50.039Z","dependency_job_id":null,"html_url":"https://github.com/yankouskia/get-browser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yankouskia/get-browser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yankouskia%2Fget-browser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yankouskia%2Fget-browser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yankouskia%2Fget-browser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yankouskia%2Fget-browser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yankouskia","download_url":"https://codeload.github.com/yankouskia/get-browser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yankouskia%2Fget-browser/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260563393,"owners_count":23028548,"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":["browser-detection","device-detection","javascript","lightweight"],"created_at":"2024-11-20T18:01:37.590Z","updated_at":"2025-06-18T13:42:04.409Z","avatar_url":"https://github.com/yankouskia.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/yankouskia/get-browser/pulls) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/yankouskia/get-browser/blob/master/LICENSE)\n\n[![NPM](https://nodei.co/npm/get-browser.png?downloads=true)](https://www.npmjs.com/package/get-browser)\n\n# get-browser\n\n💻 Lightweight tool to identify the browser (with mobile/desktop detection) 📱\n\n\n| \u003cimg src=\"https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/internet-explorer/internet-explorer_512x512.png\" alt=\"IE\" width=\"48px\" height=\"48px\"/\u003e\u003c/br\u003e Internet Explorer | \u003cimg src=\"https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/edge/edge_512x512.png\" alt=\"Edge\" width=\"48px\" height=\"48px\" /\u003e\u003c/br\u003e Microsoft Edge | \u003cimg src=\"https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/firefox/firefox_512x512.png\" alt=\"Firefox\" width=\"48px\" height=\"48px\" /\u003e\u003cimg src=\"https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/firefox-developer-edition/firefox-developer-edition_512x512.png\" alt=\"Firefox Dev\" width=\"48px\" height=\"48px\" /\u003e\u003c/br\u003e Mozilla Firefox | \u003cimg src=\"https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/chrome/chrome_512x512.png\" alt=\"Chrome\" width=\"48px\" height=\"48px\" /\u003e\u003cimg src=\"https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/chrome-dev/chrome-dev_512x512.png\" alt=\"Chrome Dev\" width=\"48px\" height=\"48px\" /\u003e\u003cimg src=\"https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/archive/chrome-canary_19-48/chrome-canary_19-48_512x512.png\" alt=\"Chrome Canary\" width=\"48px\" height=\"48px\" /\u003e\u003c/br\u003e Google Chrome | \u003cimg src=\"https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/opera/opera_512x512.png\" alt=\"Opera\" width=\"48px\" height=\"48px\" /\u003e\u003cimg src=\"https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/opera-developer/opera-developer_512x512.png\" alt=\"Opera Dev\" width=\"48px\" height=\"48px\" /\u003e\u003c/br\u003e Opera | \u003cimg src=\"https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/safari/safari_512x512.png\" alt=\"Safari\" width=\"48px\" height=\"48px\" /\u003e\u003cimg src=\"https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/safari-technology-preview/safari-technology-preview_512x512.png\" alt=\"Safari TP\" width=\"48px\" height=\"48px\" /\u003e\u003cimg src=\"https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/safari-ios/safari-ios_512x512.png\" alt=\"Safari iOS\" width=\"48px\" height=\"48px\" /\u003e\u003c/br\u003e Safari | \u003cimg src=\"https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/android-webview-beta/android-webview-beta_512x512.png\" alt=\"Android WebView\" width=\"48px\" height=\"48px\" /\u003e\u003c/br\u003e Android WebView\n| --- | --- | --- | --- | --- | --- | ---\n| 7+ | 12+ | 5+ | 31+ | 18+ | 6+ | 20+\n\n\n## Demo\n\n[DEMO can be found here](https://yankouskia.github.io/get-browser/example/index.html)\n\n\nDesktop Chrome            |  Mobile Safari\n:-------------------------:|:-------------------------:\n\u003cimg src=\"./resources/desktop_chrome.gif\" data-canonical-src=\"./resources/desktop_chrome.gif\" width=\"300\" /\u003e  |  \u003cimg src=\"./resources/mobile_safari.gif\" data-canonical-src=\"./resources/mobile_safari.gif\" width=\"300\" /\u003e\n\n## Motivation\n\nLightweight tool for easy way to identify the browser. User Agent does not always provide entire information about the browser. Additional checks are used.\n\n## How to use\n\nTo install library:\n\n```sh\n# yarn\nyarn add get-browser\n\n# npm\nnpm install get-browser --save\n```\n\nLibrary is designed to identify browser and device type (mobile / desktop)\n\n```js\n// ES6 modules\nimport {\n  browsers,\n  detect,\n  isMobile,\n\n  isAndroid,\n  isChrome,\n  isEdge,\n  isFirefox,\n  isIE,\n  isOpera,\n  isSafari,\n} from 'get-browser';\n\n// CommonJS modules\nconst {\n  browsers,\n  detect,\n  isMobile,\n\n  isAndroid,\n  isChrome,\n  isEdge,\n  isFirefox,\n  isIE,\n  isOpera,\n  isSafari,\n} = require('get-browser');\n\n// Enumeration with all supported browsers is provided:\nconsole.log(browsers);\n/*\n{\n  ANDROID: 'android',\n  CHROME: 'chrome',\n  EDGE: 'edge',\n  FIREFOX: 'firefox',\n  IE: 'ie',\n  OPERA: 'opera',\n  SAFARI: 'safari',\n  UNKNOWN: 'unknown',\n}\n*/\n\n// To detect browser:\nconst browser = detect(); // one from the browsers list will be displayed\n\n// To detect whether mobile device is used:\nconst isMobileDevice = isMobile();\n\n// To detect whether user is in Firefox browser:\nconst isFirefoxBrowser = isFirefox();\n\n```\n\n## API\n\n`browsers`\n\nExposed enumeration for providing constant for each browser.\n\n`detect(): string\u003coneof browsers\u003e`\n\nReturns the browser name\n\n`isMobile(): boolean`\n\nReturns true if mobile device is being used\n\n`isAndroid(): boolean`\n\nReturn true if Android browser us being used\n\n`isChrome(): boolean`\n\nReturn true if Google Chrome browser us being used\n\n`isEdge(): boolean`\n\nReturn true if Edge browser us being used\n\n`isFirefox(): boolean`\n\nReturn true if Firefox browser us being used\n\n`isIE(): boolean`\n\nReturn true if Internet Explorer browser us being used\n\n`isOpera(): boolean`\n\nReturn true if Opera browser us being used\n\n`isSafari(): boolean`\n\nReturn true if Safari browser us being used\n\n\n## Contributing\n\n`get-browser` is open-source library, opened for contributions\n\n\n### License\n\n`get-browser` is [MIT licensed](https://github.com/yankouskia/get-browser/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyankouskia%2Fget-browser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyankouskia%2Fget-browser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyankouskia%2Fget-browser/lists"}