{"id":29926584,"url":"https://github.com/ecomfe/saber-env","last_synced_at":"2025-08-02T12:42:24.398Z","repository":{"id":11107729,"uuid":"13462760","full_name":"ecomfe/saber-env","owner":"ecomfe","description":"移动端浏览器环境检测","archived":false,"fork":false,"pushed_at":"2015-05-19T06:47:55.000Z","size":255,"stargazers_count":12,"open_issues_count":0,"forks_count":5,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-07-22T05:16:47.141Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ecomfe.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-10-10T05:23:35.000Z","updated_at":"2023-02-06T03:32:48.000Z","dependencies_parsed_at":"2022-09-10T11:01:17.023Z","dependency_job_id":null,"html_url":"https://github.com/ecomfe/saber-env","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/ecomfe/saber-env","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomfe%2Fsaber-env","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomfe%2Fsaber-env/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomfe%2Fsaber-env/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomfe%2Fsaber-env/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ecomfe","download_url":"https://codeload.github.com/ecomfe/saber-env/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomfe%2Fsaber-env/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268392148,"owners_count":24243297,"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","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-08-02T12:42:07.802Z","updated_at":"2025-08-02T12:42:24.369Z","avatar_url":"https://github.com/ecomfe.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"saber-env [![Build Status](https://travis-ci.org/ecomfe/saber-env.png)](https://travis-ci.org/ecomfe/saber-env)\n===\n\n移动端浏览器环境检测\n\n## Installation\n\n通过 [edp](https://github.com/ecomfe/edp) 引入模块：\n\n```sh\nedp import saber-env\n```\n\n## Usage\n\n```js\nrequire('saber-env', function(env) {\n    // detect os info\n    console.info(env.os);\n\n    // detect browser info\n    console.info(env.browser);\n});\n```\n\n返回值结构：\n\n```js\n{\n    os: {\n        phone: true,\n        tablet: false,\n        ios: true,\n        iphone: true,\n        version: '7.0.5'\n        ...\n    },\n\n    browser: {\n        chrome: true,\n        safari: true,\n        version: '31.0'\n        ...\n    }\n}\n```\n\n* _return_ `{Object}`\n    * **os** `{Object}` 系统信息对象\n    * **browser** `{Object}` 浏览器信息对象\n\n## API\n\n### Methods\n\n#### os\n\n系统信息对象，包含的可能项：\n\n+ `version`\n\n`通用平台类型`\n\n+ `phone`\n+ `tablet`\n\n`特定系统类型`\n\n+ `ios`\n+ `android`\n+ `wp`\n+ `blackberry`\n+ `bb10`\n+ `rimtabletos`\n\n`特定平台类型`\n\n+ `iphone`\n+ `ipod`\n+ `ipad`\n+ `touchpad`\n+ `kindle`\n+ `webos`\n\n\n#### browser\n\n浏览器信息对象，支持的返回值：\n\n+ `version`\n\n`通用类型`\n\n+ `chrome`\n+ `safari`\n+ `firefox`\n+ `webview`\n+ `ie`\n+ `silk`\n+ `playbook`\n\n`国产加壳类型`，检测值为以下列表时`version`取值为`浏览器壳`的版本号\n\n+ `wechat`\n+ `baidu`\n+ `qq`\n+ `uc`\n+ `sogou`\n+ `xiaomi`\n+ `liebao`\n+ `mercury`\n\n`特殊类型`\n\n+ `standalone` 浏览器全屏状态\n\n### Optional Modules\n\n* [Media](./doc/media.md)\n* [Connection](./doc/connection.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecomfe%2Fsaber-env","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fecomfe%2Fsaber-env","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecomfe%2Fsaber-env/lists"}