Add Google Chrome flags when running devtool to force a separate Chrome instance#48908
Add Google Chrome flags when running devtool to force a separate Chrome instance#48908hrastnik wants to merge 2 commits into
Conversation
|
Hi @hrastnik! Thank you for your pull request and welcome to our community. Action RequiredIn 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. ProcessIn 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 If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
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.
|
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.