dillon1000/react

Commit

[DevTools] upgrade to Manifest V3 (#25145)

## Summary

resolves #24522

To upgrade to Manifest V3, one of the biggest issue is that we are no
longer allowed to add a script element with code in textContent so that
it would run synchronously. It's necessary for us because we need to
inject a global hook for react reconciler to detect whether devtools
exist.
To do that, we'll leverage a new API
`chrome.scripting.registerContentScripts` in V3. Particularly, we rely
on the "world" option (added in Chrome v102
[commit](https://chromium.googlesource.com/chromium/src/+/e5ad3451c17b21341b0b9019b074801c44c92c9f))
to run it in the "main world" on the page.

This PR also renames a few content script files so that it's easier to
tell them apart from other extension scripts and understand the purpose
of each of them.

Manifest V3 is not yet ready for Firefox, so we need to keep some code
for compatibility.

## How did you test this change?

`yarn build:chrome && yarn test:chrome`
`yarn build:edge && yarn test:edge`
`yarn build:firefox && yarn test:firefox`
Browse files
Changed paths14 files
First-parent comparison
M packages/react-devtools-extensions/chrome/manifest.json ModifiedM packages/react-devtools-extensions/edge/manifest.json ModifiedM packages/react-devtools-extensions/firefox/manifest.json ModifiedM packages/react-devtools-extensions/src/background.js ModifiedA packages/react-devtools-extensions/src/contentScripts/installHook.js AddedR packages/react-devtools-extensions/src/injectGlobalHook.js →packages/react-devtools-extensions/src/contentScripts/prepareInjection.js RenamedR packages/react-devtools-extensions/src/contentScript.js →packages/react-devtools-extensions/src/contentScripts/proxy.js RenamedA packages/react-devtools-extensions/src/contentScripts/renderer.js AddedD packages/react-devtools-extensions/src/renderer.js DeletedM packages/react-devtools-extensions/src/utils.js ModifiedM packages/react-devtools-extensions/webpack.config.js ModifiedM packages/react-devtools-shared/src/devtools/views/Components/Tree.css ModifiedM packages/react-devtools-shared/src/devtools/views/Components/Tree.js ModifiedM packages/react-devtools/README.md Modified
Patch

Files changed

Rendering syntax-highlighted changes…