chrome-launcher icon indicating copy to clipboard operation
chrome-launcher copied to clipboard

handle "Google Chrome quit unexpectedly"

Open devtools-bot opened this issue 8 years ago • 3 comments

From @gwuhaolin on June 15, 2017 2:46

Sometime Chrome quit unexpectedly or has no response, chrome-launcher should handle this error and restart a chrome or emit a event to notify developer.

Copied from original issue: GoogleChrome/lighthouse#2503

devtools-bot avatar Aug 29 '17 21:08 devtools-bot

From @gwuhaolin on June 30, 2017 6:32

I rewrite chrome-launcher with this feature, see chrome-runner.

devtools-bot avatar Aug 29 '17 21:08 devtools-bot

From @paulirish on June 30, 2017 17:44

Hi @gwuhaolin! Very sorry for not responding to your issue. I really appreciate you filing a ticket. :)

I read your blog post at https://github.com/gwuhaolin/blog/issues/7 and its really interesting. Very cool.

I've been looking at chrome-runner and like what you did with it. 👍 I'd love to help incorporate your improvements back into chrome-launcher, if you're interested.

I was looking at the source and noticed a few things:

  • I saw you added '--disable-suggestions-ui'. I didn't know this but I looked it up and from what I can tell it's an iOS-only feature, so I don't think it matters: https://codereview.chromium.org/2643753002/
  • You also added '--disable-speech-api', which kills off https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API
  • The handleChromeUnexpectedExit is really great and launcher should definitely have it. Are you okay if I copy your implementation back to chrome-launcher?
  • I have a PR for launcher that adds retries if Chrome's debug port doesn't appear to be open. This also fixes a bug where the .on('SIGINT') handler was being bound for every launch, which node.js doesn't like and warns about.

how does all that sound?

devtools-bot avatar Aug 29 '17 21:08 devtools-bot

From @gwuhaolin on July 1, 2017 9:57

@paulirish It's a pleasure to be appreciated by you.😊

I have taken your advice remove flags --disable-suggestions-ui --disable-speech-api in chrome-runner.

chrome-runner's goal is:

  • just a lib to launch chrome, don't mix with other things like lighthouse-logger and ask in chrome-launcher. The advantage is that others project can reuse it without encumbrance.
  • chrome-runner a is separate project not like chrome-launcher is in lighthouse. The advantage is more convenient management and chase issues.

I made a series of chrome related small and reusable tools: chrome tools

If possible I would be honored to transfer their ownership to the GoogleChrome community, because there are more people in the community who can improve them.

chrome-runner(required node7+) has the advantage of comparison with chrome-launcher:

  • rewrite with less and simple code in javascript by support typescript
  • provide events emit to hook
  • also support chrome-launcher supported options
  • well unit test and used in products to ensure quality
  • well design API and detail doc

If possible to use chrome-runner to replace chrome-launcher in lighthouse, I would like to submit a merge.

devtools-bot avatar Aug 29 '17 21:08 devtools-bot