Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reapply changes from #22631 #22645

Merged
merged 1 commit into from
Oct 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions packages/react-devtools-extensions/src/backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -56,7 +55,6 @@ function setup(hook, extensionId) {
{
source: 'react-devtools-bridge',
payload: {event, payload},
extensionId,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oooh so this was something we missed in #22638?

Copy link
Contributor Author

@jstejada jstejada Oct 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, although it shouldn't really cause any issues

},
'*',
transferable,
Expand Down
3 changes: 2 additions & 1 deletion packages/react-devtools-extensions/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const LOCAL_STORAGE_SUPPORTS_PROFILING_KEY =
'React::DevTools::supportsProfiling';

const isChrome = getBrowserName() === 'Chrome';
const isEdge = getBrowserName() === 'Edge';

let panelCreated = false;

Expand Down Expand Up @@ -149,7 +150,7 @@ function createPanelIfReactLoaded() {

store = new Store(bridge, {
isProfiling,
supportsReloadAndProfile: isChrome,
supportsReloadAndProfile: isChrome || isEdge,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

supportsProfiling,
// At this time, the scheduling profiler can only parse Chrome performance profiles.
supportsSchedulingProfiler: isChrome,
Expand Down