{"id":27118615,"url":"https://github.com/doga/browser-detector","last_synced_at":"2025-08-20T15:02:17.080Z","repository":{"id":228068749,"uuid":"773025077","full_name":"doga/browser-detector","owner":"doga","description":"JavaScript library for browser type detection.","archived":false,"fork":false,"pushed_at":"2024-10-21T09:18:53.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-21T13:13:40.558Z","etag":null,"topics":["es6-javascript","javascript-library","web-development"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/doga.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-16T14:37:00.000Z","updated_at":"2024-10-21T09:18:56.000Z","dependencies_parsed_at":"2024-03-16T23:34:39.510Z","dependency_job_id":"c7966f37-f781-426e-beed-78e6e1d758b9","html_url":"https://github.com/doga/browser-detector","commit_stats":null,"previous_names":["doga/browser-detector"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doga%2Fbrowser-detector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doga%2Fbrowser-detector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doga%2Fbrowser-detector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doga%2Fbrowser-detector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doga","download_url":"https://codeload.github.com/doga/browser-detector/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247615457,"owners_count":20967183,"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":["es6-javascript","javascript-library","web-development"],"created_at":"2025-04-07T07:59:09.791Z","updated_at":"2025-04-07T07:59:10.470Z","avatar_url":"https://github.com/doga.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# browser-detector\n\nJavaScript library for browser type detection. Runs in all JavaScript runtimes.\n\n## Usage example\n\n_Tip: Run the examples below by typing this in your terminal (requires [Deno](https://deno.com/) 2+):_\n\n```shell\ndeno run \\\n  --allow-net --allow-run --allow-env --allow-read \\\n  jsr:@andrewbrey/mdrb@3.0.4 \\\n  --dax=false \\\n  https://raw.githubusercontent.com/doga/browser-detector/master/README.md\n```\n\n\u003cdetails data-mdrb\u003e\n\u003csummary\u003eExample: Infer the browser type from a User-Agent string.\u003c/summary\u003e\n\n\u003cpre\u003e\ndescription = '''\nRunning this code is safe.\n'''\n\u003c/pre\u003e\n\u003c/details\u003e\n\n```javascript\nimport {\n  detectBrowser,\n  Browser, \n  ChromeDesktop, EdgeDesktop, OperaDesktop, FirefoxDesktop, SafariDesktop,\n  VivaldiDesktop, WaveboxDesktop, ArcDesktop, BraveDesktop,\n  FirefoxAndroid, KiwiAndroid,\n  SafariMobile\n} from 'https://esm.sh/gh/doga/browser-detector@0.3.0/mod.mjs';\n\nconst\nuserAgent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:121.0) Gecko/20100101 Firefox/121.0',\nbrowsers  = detectBrowser(userAgent),\nbrowser   = browsers.find(browser =\u003e browser instanceof FirefoxDesktop);\n\nconsole.info(`Number of matched browsers:     ${browsers.length}`);\nconsole.info(`Browser matches FirefoxDesktop: ${!!browser}\\n`);\nif(browser){\n  console.info(`User agent string: ${browser}`);\n  console.info(`Device type:       ${browser.deviceType}`);\n  console.info(`System info:       ${browser.systemInfo}`);\n  console.info(`Platform name:     ${browser.platformName}`);\n  console.info(`Platform version:  ${browser.platformVersion}`);\n  console.info(`Platform details:  ${browser.platformDetails}`);\n  console.info(`Extensions:        ${JSON.stringify(browser.extensions)}`);\n}\n```\n\nSample output for the code above:\n\n```text\nNumber of matched browsers:     1\nBrowser matches FirefoxDesktop: true\n\nUser agent string: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:121.0) Gecko/20100101 Firefox/121.0\nDevice type:       Macintosh\nSystem info:       Macintosh,Intel Mac OS X 10.15,rv:121.0\nPlatform name:     Gecko\nPlatform version:  20100101\nPlatform details:  undefined\nExtensions:        [{\"name\":\"Firefox\",\"version\":\"121.0\"}]\n```\n\n∎\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoga%2Fbrowser-detector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoga%2Fbrowser-detector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoga%2Fbrowser-detector/lists"}