dillon1000/react
Commit
Browse files feat[react-devtools/extension]: use chrome.storage to persist settings across sessions (#30636)
Stacked on https://github.com/facebook/react/pull/30610 and whats under it. See [last commit](https://github.com/facebook/react/pull/30636/commits/248ddba18608e1bb5ef14c823085a7ff9d7a54a3). Now, we are using [`chrome.storage`](https://developer.chrome.com/docs/extensions/reference/api/storage) to persist settings for the browser extension across different sessions. Once settings are updated from the UI, the `Store` will emit `settingsUpdated` event, and we are going to persist them via `chrome.storage.local.set` in `main/index.js`. When hook is being injected, we are going to pass a `Promise`, which is going to be resolved after the settings are read from the storage via `chrome.storage.local.get` in `hookSettingsInjector.js`.
Changed paths12 files
First-parent comparisonpackages/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/dynamicallyInjectContentScripts.js ModifiedA packages/react-devtools-extensions/src/contentScripts/hookSettingsInjector.js AddedM packages/react-devtools-extensions/src/contentScripts/installHook.js ModifiedM packages/react-devtools-extensions/src/main/index.js ModifiedD packages/react-devtools-extensions/src/main/syncSavedPreferences.js DeletedM packages/react-devtools-extensions/webpack.config.js ModifiedM packages/react-devtools-shared/src/backend/agent.js ModifiedM packages/react-devtools-shared/src/backend/types.js ModifiedM packages/react-devtools-shared/src/devtools/store.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…