react/packages/react-devtools-extensions
Mengdi Chen f718199313
[DevTools] browser extension: improve script injection logic (#26492)
## Summary

- Drop extension support for Chrome / Edge <v102 since they have less
than 0.1% usage ([see data](https://caniuse.com/usage-table))
- Improve script injection logic when possible so that the scripts
injected by the extension are no longer shown in Network (which caused a
lot of confusion in the past)

## How did you test this change?

Built and tested locally, works as usual on Firefox.

For Chrome/Edge

**Before:**
Scripts shown in Network tab
<img width="1279" alt="Untitled 2"
src="https://user-images.githubusercontent.com/1001890/228074363-1d00d503-d4b5-4339-8dd6-fd0467e36e3e.png">

**After:**
No scripts shown
<img width="1329" alt="image"
src="https://user-images.githubusercontent.com/1001890/228074596-2084722b-bf3c-495e-a852-15f122233155.png">

---------

Co-authored-by: Ruslan Lesiutin <rdlesyutin@gmail.com>
2023-03-28 12:45:53 -04:00
..
.circleci Reorganized things again into packages 2019-08-13 11:37:25 -07:00
chrome [DevTools] browser extension: improve script injection logic (#26492) 2023-03-28 12:45:53 -04:00
edge [DevTools] browser extension: improve script injection logic (#26492) 2023-03-28 12:45:53 -04:00
firefox React DevTools 4.27.3 -> 4.27.4 (#26470) 2023-03-24 15:45:26 -04:00
flow-typed Migrate testRunner from jasmine2 to jest-circus (#26144) 2023-02-10 13:39:14 -05:00
icons Optimized DevTools extension images 2021-08-02 09:32:46 -04:00
popups Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
src [DevTools] browser extension: improve script injection logic (#26492) 2023-03-28 12:45:53 -04:00
README.md Include install command for devtools-extension build instructions (#25053) 2022-10-05 11:27:09 -04:00
build.js Prevent errors/crashing when multiple installs of DevTools are present (#22517) 2021-10-14 17:15:31 -04:00
deploy.chrome.html Fixed a bunch of Lint issues 2019-08-13 21:59:07 -07:00
deploy.edge.html React developer tools extension for Microsoft Edge (#18041) 2020-02-18 09:40:30 -08:00
deploy.firefox.html Fixed a bunch of Lint issues 2019-08-13 21:59:07 -07:00
deploy.html make link https (#19147) 2020-06-30 12:43:52 +01:00
deploy.js Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
improveImages.mjs [DevTools] Optimize Images yarn command (part 2) (#21968) 2021-08-02 09:32:17 -04:00
main.html Fixed a bunch of Lint issues 2019-08-13 21:59:07 -07:00
package.json Update Rollup to 3.x (#26442) 2023-03-24 18:08:41 +00:00
panel.html Fixed a bunch of Lint issues 2019-08-13 21:59:07 -07:00
utils.js [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
webpack.backend.js [DevTools] fix local build for extension (#26067) 2023-01-27 15:35:07 -05:00
webpack.config.js [DevTools] Remove renderer.js from extension build (#26234) 2023-03-03 14:01:58 -05:00

README.md

This is the source code for the React DevTools browser extension.

Installation

The easiest way to install this extension is as a browser add-on:

Local development

You can also build and install this extension from source.

Prerequisite steps

DevTools depends on local versions of several NPM packages1 also in this workspace. You'll need to either build or download those packages first.

1 Note that at this time, an experimental build is required because DevTools depends on the createRoot API.

To install all necessary dependencies, run the following command from the root of the repository:

yarn install

Build from source

To build dependencies from source, run the following command from the root of the repository:

yarn build-for-devtools

Download from CI

To use the latest build from CI, run the following commands starting from the root of the repository:

cd scripts/release
yarn install
./download-experimental-build.js

Build steps

Once the above packages have been built or downloaded, you can build the extension by running:

cd packages/react-devtools-extensions/

yarn build:chrome # => packages/react-devtools-extensions/chrome/build
yarn run test:chrome # Test Chrome extension

yarn build:firefox # => packages/react-devtools-extensions/firefox/build
yarn run test:firefox # Test Firefox extension

yarn build:edge # => packages/react-devtools-extensions/edge/build
yarn run test:edge # Test Edge extension