Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Live Development changes Chrome's home page for that session (OS X) #2998

Closed
alltom opened this issue Feb 28, 2013 · 11 comments
Closed

Live Development changes Chrome's home page for that session (OS X) #2998

alltom opened this issue Feb 28, 2013 · 11 comments
Assignees
Milestone

Comments

@alltom
Copy link
Contributor

alltom commented Feb 28, 2013

Start Live Development
Let Brackets restart Chrome with remote debugging enabled
Close all Chrome windows
Click the Chrome dock icon

Expected: new window opens with my "New Tab" page
Actual: new window opens with the Live Development redirection page

/cc @joelrbrandt

@ghost ghost assigned gruehle Mar 1, 2013
@pthiess
Copy link
Contributor

pthiess commented Mar 1, 2013

@gruehle - consider this a low(er) priority.

@joelrbrandt
Copy link
Contributor

@gruehle the reason this is happening is that when we re-launch chrome (on mac), we put the url to be opened in the command line. Chrome treats this as the url to open on any re-launch (which is what happens when you click the dock icon).

I think the fix would be to re-launch chrome without the url and then once we see chrome open, to fire a debugger event that opens the page.

Since we've got a story around completely re-doing the live dev connection process, maybe we can just fix this along the way?

@fungl164
Copy link
Contributor

@gruehle, @joelrbrandt it may come in handy to use a separate chrome profile for development. I tested a simple fix below that seems to work without affecting prior open sessions.

diff --git a/appshell/appshell_extensions_mac.mm b/appshell/appshell_extensions_mac.mm
index 439f5e3..f6497dd 100644
--- a/appshell/appshell_extensions_mac.mm
+++ b/appshell/appshell_extensions_mac.mm
@@ -193,6 +193,9 @@ int32 OpenLiveBrowser(ExtensionString argURL, bool enableRemoteDebugging)
parameters = [NSArray arrayWithObjects:
@"--remote-debugging-port=9222",
@"--allow-file-access-from-files",

  •                       @"--no-first-run",
    
  •                       @"--temp-profile",
    
  •                       @"--user-data-dir=/tmp/chrome-brackets",
                          nil];
       }
       else {
    

@fungl164
Copy link
Contributor

In fact, I'm almost certain you don't even have to close and re-open the browser to use it this way. :)

@redmunds
Copy link
Contributor

@fungl164 That's what we do on Windows, but it didn't work on Mac (several months ago when we tried it). Has this been fixed recently? Please let us know if you have any pointers or documentation on how to get it to work.

@fungl164
Copy link
Contributor

@redmunds I can say that it is working for me right now with those parameters.

Here is my setup:

Macbook Pro
OSX Mountain Lion - 10.8.5
Chrome - Version 29.0.1547.76
Brackets - sprint 32 development build 0.32.0-0
Bracket-shell - v0.32.0-0

I made changes to "appshell/appshell_extensions_mac.mm" as noted above & compiled with XCode 5.

The gist of it is to call chrome with the following parameters:

open Chrome.app --remote-debugging-port=9222
--allow-file-access-from-files
--no-first-run
--temp-profile
--user-data-dir=/tmp/chrome-brackets

Hope this helps. Let me know if you need more info...

@fungl164
Copy link
Contributor

Also, from what I saw the code will force a close if Chrome is already open. With these new parameters, I think that will no longer be necessary and can therefore be bypassed. I just haven't toyed with it much yet. I figure, it would be a lot faster and better for one of the core developers to take a look at it and modify it as deemed acceptable for general consumption...

@redmunds
Copy link
Contributor

Thanks. One difference I see from what I tried is --temp-profile, so maybe that's why it wouldn't work for me. Since you've already tried this in the code, do you care to submit a pull request? That would be awesome!

@redmunds
Copy link
Contributor

redmunds commented Oct 9, 2013

Nominating for Sprint 33. A lot of work was done on this during Sprint 32, so we should finish this up for Sprint 33.

@kkarlesk
Copy link
Contributor

Pushing this out to Sprint 34.

@redmunds
Copy link
Contributor

redmunds commented Nov 6, 2013

@alltom I just merged changes so that you should not see the Relaunch Chrome dialog on Mac anymore (disclaimer: this is under normal circumstances -- it's still possible to get Relaunch Chrome dialog if system is running slow and exceeds a time threshold).

You'll need to rebuild brackets-shell if you want to test this now, otherwise try out Sprint 34. Let us know if this is not fixed for you. Closing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants