{"id":48267947,"url":"https://github.com/guillevc/astro-toolbar-ua","last_synced_at":"2026-04-04T22:00:05.305Z","repository":{"id":346241045,"uuid":"1189043850","full_name":"guillevc/astro-toolbar-ua","owner":"guillevc","description":"Astro dev toolbar app for switching user agent strings","archived":false,"fork":false,"pushed_at":"2026-03-23T00:26:06.000Z","size":491,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-03-23T18:19:29.603Z","etag":null,"topics":["astro","astro-integration","astro-toolbar","browser-testing","dev-toolbar","developer-tools","user-agent","withastro"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/astro-toolbar-ua","language":"TypeScript","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/guillevc.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-22T23:05:32.000Z","updated_at":"2026-03-23T00:26:09.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/guillevc/astro-toolbar-ua","commit_stats":null,"previous_names":["guillevc/astro-toolbar-ua"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/guillevc/astro-toolbar-ua","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guillevc%2Fastro-toolbar-ua","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guillevc%2Fastro-toolbar-ua/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guillevc%2Fastro-toolbar-ua/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guillevc%2Fastro-toolbar-ua/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guillevc","download_url":"https://codeload.github.com/guillevc/astro-toolbar-ua/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guillevc%2Fastro-toolbar-ua/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31416300,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T20:09:54.854Z","status":"ssl_error","status_checked_at":"2026-04-04T20:09:44.350Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["astro","astro-integration","astro-toolbar","browser-testing","dev-toolbar","developer-tools","user-agent","withastro"],"created_at":"2026-04-04T22:00:01.722Z","updated_at":"2026-04-04T22:00:05.295Z","avatar_url":"https://github.com/guillevc.png","language":"TypeScript","readme":"# astro-toolbar-ua\n\n[![Star on GitHub](https://img.shields.io/badge/Star_on_GitHub-bc52ee?style=for-the-badge\u0026logo=github\u0026logoColor=white)](https://github.com/guillevc/astro-toolbar-ua)\n[![npm version](https://img.shields.io/npm/v/astro-toolbar-ua)](https://www.npmjs.com/package/astro-toolbar-ua)\n[![license](https://img.shields.io/npm/l/astro-toolbar-ua)](LICENSE)\n\nTest platform detection and browser-specific behavior without leaving your browser — switch user agent strings directly from the Astro dev toolbar.\n\n![astro-toolbar-ua panel showing preset UA options for Desktop, Mobile, and Browsers](docs/screenshot.png)\n\n## Install\n\nNeed to check how your site behaves on iOS, Android, or Safari? Add it in one command:\n\n```sh\n# npm\nnpx astro add astro-toolbar-ua\n\n# pnpm\npnpm astro add astro-toolbar-ua\n\n# yarn\nyarn astro add astro-toolbar-ua\n```\n\nOr install manually:\n\n```sh\nnpm install -D astro-toolbar-ua\n```\n\n```js\n// astro.config.mjs\nimport { defineConfig } from \"astro/config\";\nimport toolbarUA from \"astro-toolbar-ua\";\n\nexport default defineConfig({\n  integrations: [toolbarUA()],\n});\n```\n\n## Usage\n\nOpen the **UA Switch** panel in the Astro dev toolbar. Pick a preset or paste a custom UA string. The page reloads with the new user agent applied.\n\nA notification dot appears on the toolbar icon when a UA override is active.\n\n### Presets\n\n| Category     | Presets               |\n| ------------ | --------------------- |\n| **Desktop**  | macOS, Windows, Linux |\n| **Mobile**   | iOS, Android          |\n| **Browsers** | Safari, Firefox, Edge |\n\nYou can also enter any custom UA string directly.\n\n## How it works\n\n1. A synchronous `\u003chead\u003e` script reads a `localStorage` key and overrides `navigator.userAgent` via `Object.defineProperty` — before any page scripts run\n2. The toolbar UI writes the selected UA string to `localStorage` and reloads the page\n3. Only runs during `astro dev` — production builds are not affected\n\n## Good to know\n\n- Only overrides client-side `navigator.userAgent`. Does not modify server-side request headers.\n- `Object.defineProperty` on `navigator.userAgent` works in Chromium and Firefox. Safari may not support it in all versions.\n\n## Support\n\nIf you find this useful, [star the repo on GitHub](https://github.com/guillevc/astro-toolbar-ua) — it helps others discover it.\n\n## License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguillevc%2Fastro-toolbar-ua","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguillevc%2Fastro-toolbar-ua","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguillevc%2Fastro-toolbar-ua/lists"}