mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Fixes https://github.com/facebook/react/issues/27119, https://github.com/facebook/react/issues/27185. Fixed: - React DevTools now works as expected when user performs in-tab navigation, previously it was just stuck. https://github.com/facebook/react/assets/28902667/b11c5f84-7155-47a5-8b5a-7e90baca5347 - When user closes browser DevTools panel, we now do some cleanup to disconnect ports and emit shutdown event for bridge. This should fix the issue with registering duplicated fibers with the same id in Store. Changed: - We reconnect proxy port once in 25 seconds, in order to [keep service worker alive](https://developer.chrome.com/docs/extensions/whatsnew/#m110-sw-idle). - Instead of unregistering dynamically injected content scripts, wen now get list of already registered scripts and filter them out from scripts that we want to inject again, see dynamicallyInjectContentScripts.js. - Split `main.js` and `background.js` into multiple files. Tested on Chromium and Firefox browsers.
24 lines
803 B
JavaScript
24 lines
803 B
JavaScript
import {
|
|
localStorageGetItem,
|
|
localStorageRemoveItem,
|
|
} from 'react-devtools-shared/src/storage';
|
|
import {LOCAL_STORAGE_SUPPORTS_PROFILING_KEY} from 'react-devtools-shared/src/constants';
|
|
|
|
function getProfilingFlags() {
|
|
// This flag lets us tip the Store off early that we expect to be profiling.
|
|
// This avoids flashing a temporary "Profiling not supported" message in the Profiler tab,
|
|
// after a user has clicked the "reload and profile" button.
|
|
let isProfiling = false;
|
|
let supportsProfiling = false;
|
|
|
|
if (localStorageGetItem(LOCAL_STORAGE_SUPPORTS_PROFILING_KEY) === 'true') {
|
|
supportsProfiling = true;
|
|
isProfiling = true;
|
|
localStorageRemoveItem(LOCAL_STORAGE_SUPPORTS_PROFILING_KEY);
|
|
}
|
|
|
|
return {isProfiling, supportsProfiling};
|
|
}
|
|
|
|
export default getProfilingFlags;
|