{"id":14985510,"url":"https://github.com/jasperck/storybook-addon-user-agent","last_synced_at":"2025-04-11T21:53:07.625Z","repository":{"id":57098552,"uuid":"163363496","full_name":"jasperck/storybook-addon-user-agent","owner":"jasperck","description":"Addon to provide a user-agent switcher for storybook","archived":false,"fork":false,"pushed_at":"2019-02-18T08:17:43.000Z","size":196,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T21:53:01.429Z","etag":null,"topics":["react","storybook","storybooks","user-agent","userscript"],"latest_commit_sha":null,"homepage":null,"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/jasperck.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":"2018-12-28T03:54:21.000Z","updated_at":"2025-02-17T09:04:47.000Z","dependencies_parsed_at":"2022-08-20T19:40:09.896Z","dependency_job_id":null,"html_url":"https://github.com/jasperck/storybook-addon-user-agent","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasperck%2Fstorybook-addon-user-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasperck%2Fstorybook-addon-user-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasperck%2Fstorybook-addon-user-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasperck%2Fstorybook-addon-user-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jasperck","download_url":"https://codeload.github.com/jasperck/storybook-addon-user-agent/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248487733,"owners_count":21112188,"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":["react","storybook","storybooks","user-agent","userscript"],"created_at":"2024-09-24T14:11:07.556Z","updated_at":"2025-04-11T21:53:07.596Z","avatar_url":"https://github.com/jasperck.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# storybook-addon-user-agent\nThis addon for storybook will allow you to view your component rendering with different user-agent.\n\n![ua-switcher-screenshot](doc/ua-switcher-screenshot.png)\n\n## Getting Started\nFirst, install the addon\n```\nyarn add -D storybook-addon-user-agent\n```\n\nRegister the addon\n```js\n// addons.js\nimport 'storybook-addon-user-agent/dist/register';\n```\n\nDone!\n\n## Work with **bowser**\nSometimes we use [**bowser**](https://github.com/lancedikson/bowser) in our project for browser detection which depends on user-agent identification. Since we want **bowser** re-parse current user-agent right after we select new user-agent (which might not be workable in current major version v1.x of bowser, and looks like it will come with v2. I'm not sure for it, please update me if I'm missing something here 🙏).  \nIn this case, you can use the bowser module we provided here. In fact, it just a module extended the origin **bowser** with detecting whether you are working in `storybook` or not, if so, it'll parse **user-agent** every execution, if not, then it will just work as usual.\n```js\n// change\nimport bowser from 'bowser';\n// to\nimport bowser from 'storybook-addon-user-agent/bowser';\n\n// usage is same as usual\n// bowser.mobile, ...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasperck%2Fstorybook-addon-user-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjasperck%2Fstorybook-addon-user-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasperck%2Fstorybook-addon-user-agent/lists"}