Prevent Chrome debugger from stealing focus in React Native

981 views Asked by At

I use Chrome Debugging and Live Reload to debug React Native applications. Whenever you save a file, the Chrome screen reloads and in doing this, gets focus. This is annoying. Is there anyway to disable this focusing behaviour?

1

There are 1 answers

0
rjpower On

The Chrome debug page is opened by the launchChromeDevTools.applescript script in the react-native package.

You can disable it grabbing the focus by opening this file in your project:

./node_modules/react-native/packager/launchChromeDevTools.applescript

and commenting out the activate line by inserting -- in front.

(This annoyed me enough to hunt down how to do it; it might be worth filing an issue on react-native to make it an option).