{"id":15711772,"url":"https://github.com/jacksteamdev/crx-react-devtools","last_synced_at":"2025-05-12T21:49:07.303Z","repository":{"id":41998685,"uuid":"480595922","full_name":"jacksteamdev/crx-react-devtools","owner":"jacksteamdev","description":null,"archived":false,"fork":false,"pushed_at":"2022-04-28T21:06:33.000Z","size":118,"stargazers_count":22,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-20T18:38:59.942Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/jacksteamdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2022-04-12T00:21:27.000Z","updated_at":"2025-02-08T22:49:40.000Z","dependencies_parsed_at":"2022-08-12T01:50:46.168Z","dependency_job_id":null,"html_url":"https://github.com/jacksteamdev/crx-react-devtools","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/jacksteamdev%2Fcrx-react-devtools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacksteamdev%2Fcrx-react-devtools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacksteamdev%2Fcrx-react-devtools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacksteamdev%2Fcrx-react-devtools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jacksteamdev","download_url":"https://codeload.github.com/jacksteamdev/crx-react-devtools/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253830269,"owners_count":21970993,"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":[],"created_at":"2024-10-03T21:13:54.936Z","updated_at":"2025-05-12T21:49:07.280Z","avatar_url":"https://github.com/jacksteamdev.png","language":"TypeScript","readme":"# Vite-React Devtools Extension\n\n\u003e These instructions assume you're familiar with Chrome Extension development.\n\u003e If this is new to you, take a quick look at this article:\n\u003e\n\u003e [Create a Vite-React Chrome Extension in 90 seconds](https://dev.to/jacksteamdev/create-a-vite-react-chrome-extension-in-90-seconds-3df7).\n\n## Getting started\n\n### In the terminal\n\n1. Run `npm install`\n2. Run `npm run dev` to start building\n\n### In the browser\n\n3. Navigate to `chrome://extensions`\n4. Enable developer mode\n5. Drag the folder `dist/` onto `chrome://extensions`\n6. Click the \"service worker\" link in the extension panel\n\n![service worker link](./worker-link.png)\n\n1. Open a page for development\n2. Open the devtools inspector\n3. Click \"React Counter\" in the devtools panel tabs\n\n![devtools panel](./devtools-panel.png)\n\n4.  Click the \"devtools://...\" link in the extension panel to inspect the devtools page\n\n![devtools link](./devtools-link.png)\n\n## Development Tips\n\nSometimes during development the devtools inspector link does not show in the extension dashboard. If this is the case, navigate to `chrome://inspect` and click the \"Other\" tab.\n\nVite must be running for the developement build of the extension to work. When you're ready to share your work, run `pnpm build` to output a production build of the extension.\n\n## Architecture\n\nThis boilerplate puts the manifest in `vite.config.ts`. It declares two entry points: a devtools page and a content script.\n\n```javascript\n// vite.config.ts\n\nconst manifest = defineManifest({\n  manifest_version: 3,\n  name: \"CRX devtools extension\",\n  version,\n  content_scripts: [\n    {\n      js: [\"src/content-script.ts\"],\n      matches: [\"\u003call_urls\u003e\"],\n      run_at: \"document_start\",\n    },\n  ],\n  devtools_page: \"src/devtools.html\",\n});\n```\n\n`content_scripts`: This content script injects a main world script. You can use this this main world script to access the JavaScript execution environment of the host page. Note the query string `?script\u0026module`. It designates that the main world script import should output a file in ES module format and only import the script path.\n\n```javascript\nimport mainWorld from \"./content-main-world?script\u0026module\";\nconst script = document.createElement(\"script\");\nscript.src = chrome.runtime.getURL(mainWorld);\n```\n\n`devtools_page`: You won't see this page, but you can inspect it in the \"devtools://...\" inspector. The devtools page has access to the [Chrome Devtools Panel API](https://developer.chrome.com/docs/extensions/reference/devtools_panels/), which you can use to create a visible panel in the inspector.\n\nWorking in the devtools page is different than a normal HTML page. While HMR will work as expected in the panel (`src/panel.html`), the devtools page (`src/devtools.html`) behaves differently.\n\nOnce the devtools page creates a panel, it can't be destroyed using the Chrome API, even after a full page reload. This means that when you make major changes to `src/devtools.ts`, you may need to close the inspector and reload the page you're using for development.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacksteamdev%2Fcrx-react-devtools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacksteamdev%2Fcrx-react-devtools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacksteamdev%2Fcrx-react-devtools/lists"}