Skip to content

Add Google Chrome flags when running devtool to force a separate Chrome instance#48908

Closed
hrastnik wants to merge 2 commits into
facebook:mainfrom
hrastnik:improve-dx-chrome-flags
Closed

Add Google Chrome flags when running devtool to force a separate Chrome instance#48908
hrastnik wants to merge 2 commits into
facebook:mainfrom
hrastnik:improve-dx-chrome-flags

Conversation

@hrastnik
Copy link
Copy Markdown
Contributor

Summary:

On macOS, pressing Cmd + Q typically closes an app. However, since the React Native dev tools run as a Chrome instance, using Cmd + Q to close the dev tools also closes all open Chrome windows. This can be problematic, as it leads to losing not just the dev tools, but any other active Chrome sessions as well, without the usual "Hold to Quit" prompt that standard Chrome windows provide.

This happened to me more than once, and I wanted to address this by ensuring that the dev tools run in a separate, independent Chrome instance. To achieve this, I added the --user-data-dir flag when launching the dev server. As a result, closing the dev tools no longer results in closing all Chrome windows, preserving other active sessions.

Additionally, this change makes the dev tools appear as a separate icon when using Cmd + Tab to switch between apps, making it easier to navigate between your development tools and other applications.

Changelog:

[GENERAL] [CHANGED] - React Native DevTools now run as a separate chrome instance

Test Plan:

Run the DevTools, and ensure nothing breaks.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

Hi @hrastnik!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Jan 23, 2025
@huntie
Copy link
Copy Markdown
Member

huntie commented Jan 24, 2025

Hey @hrastnik, you rightly point out that our Chrome window/profile handling isn't perfect.

For your PR — we used to have this separate Chrome profile strategy. However, this was reverted, due to strong drawbacks (e.g. taking over system URL handling).

Unfortunately, there's no perfect launch solution with the system browser until we ship our own desktop wrapper.

@huntie huntie closed this Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants