mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
@@ -13,16 +13,15 @@ function welcome(event) {
|
||||
) {
|
||||
return;
|
||||
}
|
||||
const extensionId = event.data.extensionId;
|
||||
|
||||
window.removeEventListener('message', welcome);
|
||||
|
||||
setup(window.__REACT_DEVTOOLS_GLOBAL_HOOK__, extensionId);
|
||||
setup(window.__REACT_DEVTOOLS_GLOBAL_HOOK__);
|
||||
}
|
||||
|
||||
window.addEventListener('message', welcome);
|
||||
|
||||
function setup(hook, extensionId) {
|
||||
function setup(hook) {
|
||||
if (hook == null) {
|
||||
// DevTools didn't get injected into this page (maybe b'c of the contentType).
|
||||
return;
|
||||
@@ -56,7 +55,6 @@ function setup(hook, extensionId) {
|
||||
{
|
||||
source: 'react-devtools-bridge',
|
||||
payload: {event, payload},
|
||||
extensionId,
|
||||
},
|
||||
'*',
|
||||
transferable,
|
||||
|
||||
@@ -27,6 +27,7 @@ const LOCAL_STORAGE_SUPPORTS_PROFILING_KEY =
|
||||
'React::DevTools::supportsProfiling';
|
||||
|
||||
const isChrome = getBrowserName() === 'Chrome';
|
||||
const isEdge = getBrowserName() === 'Edge';
|
||||
|
||||
let panelCreated = false;
|
||||
|
||||
@@ -149,7 +150,7 @@ function createPanelIfReactLoaded() {
|
||||
|
||||
store = new Store(bridge, {
|
||||
isProfiling,
|
||||
supportsReloadAndProfile: isChrome,
|
||||
supportsReloadAndProfile: isChrome || isEdge,
|
||||
supportsProfiling,
|
||||
// At this time, the scheduling profiler can only parse Chrome performance profiles.
|
||||
supportsSchedulingProfiler: isChrome,
|
||||
|
||||
Reference in New Issue
Block a user