-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
[DevTools] Browser dev tools should open default browser #510
Conversation
One possible solution is to make the websocket-proxy smarter. Instead of just broadcasting incoming messages it should be able to detect browser connection and simulator connection and pair them. If there is incoming simulator connection without existing browser counterpart, proxy should open a new browser tab. |
Great idea, @frantic. I’ll explore that over the next day or two. |
b9f4966
to
f0d2d0d
Compare
@frantic this was a bit of a hack, but there is already a comment saying “this is hacky, refresh the browser window to reattach”. Originally the chrome already open or not is happened in AppleScript. This just sets a local variable on initial browser connection and then bails out in the future. I've tested it in chrome and fx dev edition on my bus ride and it was working well for me. |
else { | ||
var debuggerURL = 'http://localhost:' + options.port + '/debugger-ui'; | ||
console.log('Launching Dev Tools in default browser...'); | ||
connected = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this means it will open the tab only once per server session.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but that’s same as it is currently (as far as I could tell).
E.g. Once you open and attempt to close or refresh the browser tab it says, “if you do this you’ll break the bridge”
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But when you close the tab and disable debugging on simulator (via Cmd+Ctrl+Z) or restart the app in Xcode, it's important that the tool can connect to the debugger again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the two use cases I’m currently missing are:
- Cmd+Ctrl+Z switches back to running js on the device. This should reset the connected state so future Cmd+D can reconnect to a browser tab.
- Restarting the simulator from XCode without closing the window should be able to reconnect.
Am I missing anything else?
This seems problematic because we use different executor implementations for Chrome/Safari (and don't support Firefox) - unless I'm missing something obvious? |
f0d2d0d
to
509a97e
Compare
@nicklockwood is this something that has changed over the past month since I opened this? At the time simply having it open my default browser worked fine. Still need to work in some time to come revisit this and finish it. Ignore the [GH Review: review-needed] label and set it back to needs-revision. I’ve only rebased master, haven’t done any additional work yet. |
@iamdustan - any interest in continuing work on this or should we close? |
@brentvatne I am interested, but am currently on 3 projects at work so my time is a bit scarce. :/ Feel free to close for now to get it off the backlog and someday I’ll make it back around to this. |
closing for now - feel free to re-open when it's ready for review - we'll need to make sure our full tool stack actually works in chrome, safari, and firebox before we enable something like this, though, otherwise it's just going to open in a broken environment. |
This allows... 1. launching Chrome on platforms other than OS X 2. users to launch their own instance of Chrome (e.g. via command line) rather than being forced to use the default instance (i.e. `tell application "Chrome"` always used the default instance) `isClientConnected()` addresses the problem in facebook#510 where the dev tools would only open once per server session.
This allows... 1. launching Chrome on platforms other than OS X 2. users to launch their own instance of Chrome (e.g. via command line) rather than being forced to use the default instance (i.e. `tell application "Chrome"` always used the default instance) `isDebuggerConnected()` addresses the problem in facebook#510 where the dev tools would only open once per server session.
This allows... 1. launching Chrome on platforms other than OS X 2. users to launch their own instance of Chrome (e.g. via command line) rather than being forced to use the default instance (i.e. `tell application "Chrome"` always used the default instance) `isDebuggerConnected()` addresses the problem in facebook#510 where the dev tools would only open once per server session.
This allows... 1. launching Chrome on platforms other than OS X 2. users to launch their own instance of Chrome (e.g. via command line) rather than being forced to use the default instance (i.e. `tell application "Chrome"` always used the default instance) `isDebuggerConnected()` addresses the problem in facebook#510 where the dev tools would only open once per server session. Add a '--dangerouslyDisableChromeDebuggerWebSecurity' flag to packager.js to enable Chrome '--disable-web-security' flag. This allows users to inspect network requests in Chrome by commenting the xhr polyfill in InitializeJavaScriptAppEngine.js: facebook#934 (comment) Usage: node packager.js --dangerouslyDisableChromeDebuggerWebSecurity or: packager.sh --dangerouslyDisableChromeDebuggerWebSecurity
This allows... 1. launching Chrome on platforms other than OS X 2. users to launch their own instance of Chrome (e.g. via command line) rather than being forced to use the default instance (i.e. `tell application "Chrome"` always used the default instance) `isDebuggerConnected()` addresses the problem in facebook#510 where the dev tools would only open once per server session. Add a '--dangerouslyDisableChromeDebuggerWebSecurity' flag to packager.js to enable Chrome '--disable-web-security' flag. This allows users to inspect network requests in Chrome by commenting the xhr polyfill in InitializeJavaScriptAppEngine.js: facebook#934 (comment) Usage: node packager.js --dangerouslyDisableChromeDebuggerWebSecurity or: packager.sh --dangerouslyDisableChromeDebuggerWebSecurity
This allows... 1. launching Chrome on platforms other than OS X 2. users to launch their own instance of Chrome (e.g. via command line) rather than being forced to use the default instance (i.e. `tell application "Chrome"` always used the default instance) `isDebuggerConnected()` addresses the problem in facebook#510 where the dev tools would only open once per server session. Add a '--dangerouslyDisableChromeDebuggerWebSecurity' flag to packager.js to enable Chrome '--disable-web-security' flag. This allows users to inspect network requests in Chrome by commenting the xhr polyfill in InitializeJavaScriptAppEngine.js: facebook#934 (comment) Usage: node packager.js --dangerouslyDisableChromeDebuggerWebSecurity or: packager.sh --dangerouslyDisableChromeDebuggerWebSecurity
This allows... 1. launching Chrome on platforms other than OS X 2. users to launch their own instance of Chrome (e.g. via command line) rather than being forced to use the default instance (i.e. `tell application "Chrome"` always used the default instance) `isDebuggerConnected()` addresses the problem in facebook#510 where the dev tools would only open once per server session. Add a '--dangerouslyDisableChromeDebuggerWebSecurity' flag to packager.js to enable Chrome '--disable-web-security' flag. This allows users to inspect network requests in Chrome by commenting the xhr polyfill in InitializeJavaScriptAppEngine.js: facebook#934 (comment) Usage: node packager.js --dangerouslyDisableChromeDebuggerWebSecurity or: packager.sh --dangerouslyDisableChromeDebuggerWebSecurity
This allows... 1. launching Chrome on platforms other than OS X 2. users to launch their own instance of Chrome (e.g. via command line) rather than being forced to use the default instance (i.e. `tell application "Chrome"` always used the default instance) `isDebuggerConnected()` addresses the problem in facebook#510 where the dev tools would only open once per server session. Add a '--dangerouslyDisableChromeDebuggerWebSecurity' flag to packager.js to enable Chrome '--disable-web-security' flag. This allows users to inspect network requests in Chrome by commenting the xhr polyfill in InitializeJavaScriptAppEngine.js: facebook#934 (comment) Usage: node packager.js --dangerouslyDisableChromeDebuggerWebSecurity or: packager.sh --dangerouslyDisableChromeDebuggerWebSecurity
This allows... 1. launching Chrome on platforms other than OS X 2. users to launch their own instance of Chrome (e.g. via command line) rather than being forced to use the default instance (i.e. `tell application "Chrome"` always used the default instance) `isDebuggerConnected()` addresses the problem in facebook#510 where the dev tools would only open once per server session. Add a '--dangerouslyDisableChromeDebuggerWebSecurity' flag to packager.js to enable Chrome '--disable-web-security' flag. This allows users to inspect network requests in Chrome by commenting the xhr polyfill in InitializeJavaScriptAppEngine.js: facebook#934 (comment) Usage: node packager.js --dangerouslyDisableChromeDebuggerWebSecurity or: packager.sh --dangerouslyDisableChromeDebuggerWebSecurity
This allows... 1. launching Chrome on platforms other than OS X 2. users to launch their own instance of Chrome (e.g. via command line) rather than being forced to use the default instance (i.e. `tell application "Chrome"` always used the default instance) `isDebuggerConnected()` addresses the problem in facebook#510 where the dev tools would only open once per server session. Add a '--dangerouslyDisableChromeDebuggerWebSecurity' flag to packager.js to enable Chrome '--disable-web-security' flag. This allows users to inspect network requests in Chrome by commenting the xhr polyfill in InitializeJavaScriptAppEngine.js: facebook#934 (comment) Usage: node packager.js --dangerouslyDisableChromeDebuggerWebSecurity or: packager.sh --dangerouslyDisableChromeDebuggerWebSecurity
This allows... 1. launching Chrome on platforms other than OS X 2. users to launch their own instance of Chrome (e.g. via command line) rather than being forced to use the default instance (i.e. `tell application "Chrome"` always used the default instance) `isDebuggerConnected()` addresses the problem in facebook#510 where the dev tools would only open once per server session. Add a '--dangerouslyDisableChromeDebuggerWebSecurity' flag to packager.js to enable Chrome '--disable-web-security' flag. This allows users to inspect network requests in Chrome by commenting the xhr polyfill in InitializeJavaScriptAppEngine.js Usage: node packager.js --dangerouslyDisableChromeDebuggerWebSecurity or: packager.sh --dangerouslyDisableChromeDebuggerWebSecurity
This allows... 1. launching Chrome on platforms other than OS X 2. users to launch their own instance of Chrome (e.g. via command line) rather than being forced to use the default instance (i.e. `tell application "Chrome"` always used the default instance) `isDebuggerConnected()` addresses the problem in facebook#510 where the dev tools would only open once per server session. Add a '--dangerouslyDisableChromeDebuggerWebSecurity' flag to packager.js to enable Chrome '--disable-web-security' flag. This allows users to inspect network requests in Chrome by commenting the xhr polyfill in InitializeJavaScriptAppEngine.js: facebook#934 (comment) Usage: node packager.js --dangerouslyDisableChromeDebuggerWebSecurity or: packager.sh --dangerouslyDisableChromeDebuggerWebSecurity
This allows... 1. launching Chrome on platforms other than OS X 2. users to launch their own instance of Chrome (e.g. via command line) rather than being forced to use the default instance (i.e. `tell application "Chrome"` always used the default instance) `isDebuggerConnected()` addresses the problem in facebook#510 where the dev tools would only open once per server session. Add a '--dangerouslyDisableChromeDebuggerWebSecurity' flag to packager.js to enable Chrome '--disable-web-security' flag. This allows users to inspect network requests in Chrome by commenting the xhr polyfill in InitializeJavaScriptAppEngine.js: facebook#934 (comment) Usage: node packager.js --dangerouslyDisableChromeDebuggerWebSecurity or: packager.sh --dangerouslyDisableChromeDebuggerWebSecurity
This allows... 1. launching Chrome on platforms other than OS X 2. users to launch their own instance of Chrome (e.g. via command line) rather than being forced to use the default instance (i.e. `tell application "Chrome"` always used the default instance) `isDebuggerConnected()` addresses the problem in facebook#510 where the dev tools would only open once per server session. Add a '--dangerouslyDisableChromeDebuggerWebSecurity' flag to packager.js to enable Chrome '--disable-web-security' flag. This allows users to inspect network requests in Chrome by commenting the xhr polyfill in InitializeJavaScriptAppEngine.js: facebook#934 (comment) Usage: node packager.js --dangerouslyDisableChromeDebuggerWebSecurity or: packager.sh --dangerouslyDisableChromeDebuggerWebSecurity
This allows... 1. launching Chrome on platforms other than OS X 2. users to launch their own instance of Chrome (e.g. via command line) rather than being forced to use the default instance (i.e. `tell application "Chrome"` always used the default instance) `isDebuggerConnected()` addresses the problem in facebook#510 where the dev tools would only open once per server session. Add a '--dangerouslyDisableChromeDebuggerWebSecurity' flag to packager.js to enable Chrome '--disable-web-security' flag. This allows users to inspect network requests in Chrome by commenting the xhr polyfill in InitializeJavaScriptAppEngine.js: facebook#934 (comment) Usage: node packager.js --dangerouslyDisableChromeDebuggerWebSecurity or: packager.sh --dangerouslyDisableChromeDebuggerWebSecurity
This allows... 1. launching Chrome on platforms other than OS X 2. users to launch their own instance of Chrome (e.g. via command line) rather than being forced to use the default instance (i.e. `tell application "Chrome"` always used the default instance) `isDebuggerConnected()` addresses the problem in facebook#510 where the dev tools would only open once per server session. Add a '--dangerouslyDisableChromeDebuggerWebSecurity' flag to packager.js to enable Chrome '--disable-web-security' flag. This allows users to inspect network requests in Chrome by commenting the xhr polyfill in InitializeJavaScriptAppEngine.js: facebook#934 (comment) Usage: node packager.js --dangerouslyDisableChromeDebuggerWebSecurity or: packager.sh --dangerouslyDisableChromeDebuggerWebSecurity
This allows opening the Chrome debugger on OS X, Linux, and Windows. `isDebuggerConnected()` addresses the problem in facebook#510 where the dev tools would only open once per server session.
This allows opening the Chrome debugger on OS X, Linux, and Windows. `isDebuggerConnected()` addresses the problem in facebook#510 where the dev tools would only open once per server session.
This allows opening the Chrome debugger on OS X, Linux, and Windows. `isDebuggerConnected()` addresses the problem in facebook#510 where the dev tools would only open once per server session.
This allows opening the Chrome debugger on OS X, Linux, and Windows. `isDebuggerConnected()` addresses the problem in facebook#510 where the dev tools would only open once per server session.
This allows opening the Chrome debugger on OS X, Linux, and Windows. `isDebuggerConnected()` addresses the problem in facebook#510 where the dev tools would only open once per server session.
…tch (facebook#510) * Add unsafeAddProp (like ReactDOMRe.Style) & unsafeTransform as escape hatch for fancy platforms (and move array/list(Option) at the top - without huge comments) This escape hatch are a necessity when using react-native-web (eg: position: fixed on the web - as you cannot always have 60fps sticky header with interpolation+translateY... Also RNW allows `translateZ`etc...) * Replace with unsafeAddStyle, unsafeStyle & unsafeTransform * Zero cost unsafeAddStyle 🤯
This changes the browser dev tools tunneling to open the default browser using *nix’s
open
command instead of applescript.Benefits:
Limitations:
I think that limitation needs to be tackled before merging. I’m not really sure where to start to tackle that. I suspect this is low priority to your team, but is this something you’d be interested in?
Closes #492