You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is annoying to restart and have a new tab opened every time.
I’m not sure how to do it but we should try to refresh the existing tab instead of opening a new one.
Yeah, there's an issue on Chrome where they don't want to implement that feature, but I've read that you can use applescript in order to do that. @frantic is doing something similar for the react native chrome debugger opening.
(We can also add something like this to React DevTools, assuming the port is more specific so we’re not handling false positives. Most people developing on React already have React DevTools.)
They replaced it with opn but check on the devserver if the tab with the websocket is already opened. Unfortunately we can't do that here because we don't maintain a running server.
It’s not very nice to force people to use Chrome. After all our friends at Mozilla are building new Firefox debugger with React 😄 . Maybe there is some way to check if Chrome is the default browser?
Activity
vjeux commentedon Jul 20, 2016
Yeah, there's an issue on Chrome where they don't want to implement that feature, but I've read that you can use applescript in order to do that. @frantic is doing something similar for the react native chrome debugger opening.
gaearon commentedon Jul 20, 2016
There’s also a Chrome extension that does it out of the box.
Maybe we can point people to it, assuming it’s easy to install: https://github.com/mbhutton/chrome-duplicate-tab-detector
gaearon commentedon Jul 20, 2016
(We can also add something like this to React DevTools, assuming the port is more specific so we’re not handling false positives. Most people developing on React already have React DevTools.)
vjeux commentedon Jul 20, 2016
facebook/react-native#3394
vjeux commentedon Jul 20, 2016
Here's the applescript that keeps the current tab: https://github.com/facebook/react-native/blob/f03c7b59fd8962682cff5797a3916882ef389871/packager/launchChromeDevTools.applescript
They replaced it with opn but check on the devserver if the tab with the websocket is already opened. Unfortunately we can't do that here because we don't maintain a running server.
gaearon commentedon Jul 20, 2016
It’s not very nice to force people to use Chrome. After all our friends at Mozilla are building new Firefox debugger with React 😄 . Maybe there is some way to check if Chrome is the default browser?
vjeux commentedon Jul 20, 2016
Absolutely, my previous solution checked if Chrome was opened before running it and the current one uses the default browser
gaearon commentedon Jul 20, 2016
👍 We could then combine your check with AppleScript and fallback to
opn
.Attempt to reuse Chrome tab on OS X
Attempt to reuse Chrome tab on OS X (#62)