-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
WIP: use chrome-launcher for handling the browser. #23
Conversation
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.
That's exciting!
lib/Browser.js
Outdated
|
||
await waitForChromeResponsive(this._remoteDebuggingPort); | ||
// this._chromeProcess.on('exit', () => { | ||
// this._terminated = 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.
can we have this back? I think it's still valuable
@@ -16,6 +16,7 @@ | |||
"author": "The Chromium Authors", | |||
"license": "SEE LICENSE IN LICENSE", | |||
"dependencies": { | |||
"chrome-launcher": "^0.1.3", |
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.
Does chrome-launcher depend on lighthouse? (i see it here) This seems to be a pretty heavy dependency to pull in, is it really needed?
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.
PR landing very soon to fix that.
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.
chrome-launcher@0.2.0
shipped without LH as a dep.
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.
fixed.
lib/Browser.js
Outdated
@@ -36,15 +38,9 @@ class Browser { | |||
*/ | |||
constructor(options) { | |||
options = options || {}; | |||
++browserId; |
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.
let's also kill it from L26
Updated and rebased. However we still need |
Closing until this is ready. |
Hi, can we use chrome-launcher with puppeteer now? |
I copy some code from chrome-launcher to make it work, but it looks so dirty. Is there a better way to archive that? Thanks. 😉 const { getPlatform } = require('chrome-launcher/utils')
const chromeFinder = require('chrome-launcher/chrome-finder')
const Puppeteer = require('puppeteer')
async function setOptionsDefaults(options)
{
if (options.executablePath === undefined) {
const installations = await chromeFinder[getPlatform()]()
if (installations.length === 0) {
throw new Error('No Chrome Installations Found')
}
options.executablePath = installations[0]
}
return options
}
class Puppeteer2 extends Puppeteer {
static async launch(options) {
options = await setOptionsDefaults(options)
return super.launch(options)
}
}
module.exports = Puppeteer2 |
this is the launcher module from lighthouse that we maintain.
https://www.npmjs.com/package/chrome-launcher
it defaults to an open port
addresses #21