{"id":15284274,"url":"https://github.com/ueokande/playwright-webextext","last_synced_at":"2026-04-06T09:02:39.264Z","repository":{"id":57750043,"uuid":"514465638","full_name":"ueokande/playwright-webextext","owner":"ueokande","description":"Playwright extensions for tesiting WebExtensions","archived":false,"fork":false,"pushed_at":"2026-02-21T02:04:16.000Z","size":329,"stargazers_count":28,"open_issues_count":14,"forks_count":8,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-21T07:55:38.584Z","etag":null,"topics":["playwright","webextensions"],"latest_commit_sha":null,"homepage":"","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/ueokande.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2022-07-16T03:24:07.000Z","updated_at":"2026-02-21T02:02:52.000Z","dependencies_parsed_at":"2024-01-13T07:55:25.584Z","dependency_job_id":"cd69446a-3803-4a10-8ab2-6602726a31e6","html_url":"https://github.com/ueokande/playwright-webextext","commit_stats":{"total_commits":49,"total_committers":3,"mean_commits":"16.333333333333332","dds":"0.26530612244897955","last_synced_commit":"ea496f2635dc464f3a64598d002217d0a74a001d"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/ueokande/playwright-webextext","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ueokande%2Fplaywright-webextext","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ueokande%2Fplaywright-webextext/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ueokande%2Fplaywright-webextext/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ueokande%2Fplaywright-webextext/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ueokande","download_url":"https://codeload.github.com/ueokande/playwright-webextext/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ueokande%2Fplaywright-webextext/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31466228,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-06T08:36:52.050Z","status":"ssl_error","status_checked_at":"2026-04-06T08:36:51.267Z","response_time":112,"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":["playwright","webextensions"],"created_at":"2024-09-30T14:52:31.424Z","updated_at":"2026-04-06T09:02:39.246Z","avatar_url":"https://github.com/ueokande.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# playwright-webextext\n\nThis extension library enables loading firefox add-ons and chromium extensions from the local filesystem for [playwright][].\n\n![Screenshot](screenshot.gif)\n\n## Install\n\nInstall by your package manager\n\n```console\n$ npm install --save playwright-webextext   # npm\n$ yarn add playwright-webextext             # yarn\n$ pnpm add playwright-webextext             # pnpm\n```\n\n## API\n\n### withExtension()\n\nThe method provides a custom browser that loads temporary extensions from the local filesystem.\n\n#### Usage\n\n```typescript\nimport { firefox, chromium } from \"playwright\";\nimport { withExtension } from \"playwright-webextext\";\n\nconst launchFirefox = async () =\u003e {\n  const browserTypeWithExtension = withExtension(\n    firefox,  // base browser type\n    \"path/to/your/extensions\",  // local directory containing manifest.json\n  );\n  // launch a browser\n  const browser = await browserTypeWithExtension.launch();\n\n  const page = await browser.newPage();\n  await page.goto(\"https://example.com/\");\n};\n\nconst launchChromium = async () =\u003e {\n  const browserTypeWithExtension = withExtension(\n    chromium,  // base browser type\n    \"path/to/your/extensions\",\n  );\n\n  // chromium extensions works only in headed browsers with persistent contexts\n  const browser = await browserTypeWithExtension.launchPersistentContext(\"\", {\n    headless: false,\n  });\n\n  const page = await browser.newPage();\n  await page.goto(\"https://example.com/\");\n};\n\nlaunchFirefox();\nlaunchChromium();\n```\n\n### createFixture()\n\nThe method provides custom fixtures that enable browsers to load add-ons and extensions.\n\n#### Usage\n\n```typescript\nimport { createFixture } from \"playwright-webextext\";\n\nconst { test, expect } = createFixture(\"path/to/your/extensions\");\n\ntest(\"should launch browser with extensions\", async ({ page }) =\u003e {\n  await page.goto(\"https://example.com/\");\n\n  // ...\n});\n```\n\n## Manifest v3 support\n\nThe playwright-webextext does not fully support manifest v3 on Firefox.\nFirefox asks users to allow loading content scripts since Manifest v3.\n\n![Prompt to allow loading content scripts](./firefox_prompt.png)\n\nBasically, the user should allow the permission on the `about:addon` page\nmanually. The playwright-webextext overrides the permission of the add-on to\nallow loading content scripts before launching the browser.\n\nThis override works when the add-on has the\n[`browser_specific_settings.gecko.id`](firefox_gecko_properties) property in\nthe manifest.json:\n\n```json\n{\n  \"browser_specific_settings\": {\n    \"gecko\": {\n      \"id\": \"webextext-examples@i-beam.org\"\n    }\n  }\n}\n```\n\nand it's necessary to launch with persistent context, using `launchPersistentContext()`.\n\n[firefox_gecko_properties]: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/browser_specific_settings#firefox_gecko_properties\n\n## How does it work\n\n### Chromium\n\nThe playwright introduces a way to install chrome extensions in the document.  Chromium supports installing extensions via [command-line options][chrome-launch-switches].  The playwright-webextext launches a chromium browser with command-line options with extension paths.  See the following document for more details:\n\n- [Chrome Extensions | Playwright](https://playwright.dev/docs/chrome-extensions)\n\nNote that using chrome extensions has two limitations: 1) the browser should run on headed mode, and 2) you should launch the browser with a persistent context (`launchPersistentContext()`).\n\n[chrome-launch-switches]: https://sites.google.com/site/chromeappupdates/launch-switches\n\n### Firefox\n\nFirefox provides a remote debugging server to control the browser via a [remote debugging protocol][].  This protocol also enables installing a temporary add-on.  The playwright-webextext installs add-ons by this protocol.\n\n[remote debugging protocol]: https://firefox-source-docs.mozilla.org/devtools/backend/protocol.html\n\n## LICENSE\n\n[MIT](./LICENSE)\n\n[playwright]: https://playwright.dev/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fueokande%2Fplaywright-webextext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fueokande%2Fplaywright-webextext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fueokande%2Fplaywright-webextext/lists"}