googlechrome / chrome-launcher Goto Github PK
View Code? Open in Web Editor NEWLaunch Google Chrome with ease from node.
Home Page: https://www.npmjs.com/package/chrome-launcher
License: Apache License 2.0
Launch Google Chrome with ease from node.
Home Page: https://www.npmjs.com/package/chrome-launcher
License: Apache License 2.0
I would like to spin up multiple instances using chrome-launcher
and then connect to them using Puppeteer. It is not clear how to obtain the websocket URL of the headless Chrome instance, e.g. ws://127.0.0.1:9222/devtools/browser/d9f8012e-94b8-4441-ad1e-1cf8de94e57f
.
chrome-launcher
only gives the port number. I have tried ws://127.0.0.1:${obtained port number}
, but I am getting 404.
Interestingly, using the same chrome-launcher, it seems like in certain running scenario's it fails to find Chrome. I encounter this using chromeless to create automated tests.
I've narrowed the cause down to https://github.com/GoogleChrome/chrome-launcher/blob/master/src/chrome-finder.ts#L170
If I change this on my local version to below it is solved. This is interesting mostly because ENV variables are supposed to be case sensitive on Windows and therefore Node.
const prefixes = [
process.env.LOCALAPPDATA,
process.env.LocalAppData,
process.env.PROGRAMFILES,
process.env.ProgramFiles,
process.env["PROGRAMFILES(X86)"],
process.env["ProgramFiles(x86)"]
].filter(Boolean);
I'm running node v8.9.4. The differences are in one case I call node index.js
which starts a process, in the failing case I use the jest
test runner. Both report the platform being win32 and end up in that part, I've got no clue how to find out where the issue would lie that suddenly makes the process.env.X accessing case sensitive.
I suggest removing this code, the flag is no longer used in chrome.
if (process.platform === 'linux') {
flags.push('--disable-setuid-sandbox');
}
Hi there!
maxConnectionRetries
is documented with a default of 10 in README.md
.
It's actual default is 50 (in chrome-launcher.ts
).
Should the readme be updated, or should the default be adjusted? A default of 50 retries with default connectionPollInterval
of 500ms seems like a really long time.
curl
line in readme to use tagged URL instead.Anything else?
I'd like to debug Google Chrome - using this module, is there a way to force Chrome to stop at the first debugger;
statement? Is there a Chrome command line option for that? I have a codebase littered with debugger;
statements, yet Chrome won't pause at them when I launch Chrome with chrome-launcher
.
If you want some SO points, I have this question on there:
https://stackoverflow.com/questions/46881436/force-google-chrome-to-pause-at-breakpoints-debugger-statements
thanks
A test for #81
see also GoogleChrome/lighthouse#4192 (comment)
i was thinking a more functional test. e.g. some module that require()s chrome-launcher successfully typechecks with TS.
I get the following error in WSL when running smokehouse in lighthouse.
Runtime error encountered: { Error: EINVAL: invalid argument, mkdir '/mnt/c/Users/WardPeeters/Projects/os/lighthouse/node_modules/.bin:'
My path env is the following:
/mnt/c/Users/<user>/Projects/os/lighthouse/node_modules/.bin:/usr/local/share/.config/yarn/link/node_modules/.bin:/mnt/c/Users/<user>/Projects/os/lighthouse/node_modules/.bin:/usr/local/share/.config/yarn/link
/node_modules/.bin:/root/.nvm/versions/node/v8.9.3/lib/node_modules/npm/bin/node-gyp-bin:/root/.nvm/versions/node/v8.9.3/bin/node_modules/npm/bin/node-gyp-bin:/mnt/c/Users/<user>/Projects/os/lighthouse/node_modules/.b
in:/usr/local/share/.config/yarn/link/node_modules/.bin:/mnt/c/Users/<user>/Projects/os/lighthouse/node_modules/.bin:/usr/local/share/.config/yarn/link/node_modules/.bin:/root/.nvm/versions/node/v8.9.3/lib/node_module
s/npm/bin/node-gyp-bin:/root/.nvm/versions/node/v8.9.3/bin/node_modules/npm/bin/node-gyp-bin:/root/.nvm/versions/node/v8.9.3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt
/c/Program Files/Docker/Docker/resources/bin:/mnt/c/Windows/System32:/mnt/c/Windows:/mnt/c/Windows/System32/wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0:/mnt/c/ProgramData/chocolatey/bin:/mnt/c/Program Files/dotnet:
/mnt/c/Program Files/Microsoft SQL Server/130/Tools/Binn:/mnt/c/Users/<user>/AppData/
From @Sudarson59 on March 1, 2017 13:37
When I run lighthouse I stuck at the below error in launching chrome browser,
Chrome: 56.0.2924.87 (64-bit)
LIGHTHOUSE_CHROMIUM_PATH = /usr/bin/google-chrome-stable
Lighthouse Cli invocation
./lighthouse http://abcd.test.com/ --verbose
Lighthouse CLI:verbose Using supplied port 9222 +0ms
Lighthouse CLI Launching Chrome... +8ms
ChromeLauncher:verbose created /tmp/lighthouse.rmRno9z +7ms
ChromeLauncher:verbose Chrome running with pid 24444 on port 9222. +25ms
ChromeLauncher Waiting for browser. +0ms
ChromeLauncher Waiting for browser... +1ms
ChromeLauncher Waiting for browser..... +504ms
ChromeLauncher Waiting for browser....... +501ms
ChromeLauncher Waiting for browser......... +502ms
ChromeLauncher Waiting for browser........... +501ms
ChromeLauncher Waiting for browser............. +501ms
ChromeLauncher Waiting for browser............... +502ms
ChromeLauncher Waiting for browser................. +501ms
ChromeLauncher Waiting for browser................... +501ms
ChromeLauncher Waiting for browser..................... +502ms
ChromeLauncher Waiting for browser....................... +501ms
(node:24423) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'kill' of undefined
Chrome Error Log:
[24444:24444:0301/185543.506507:FATAL:zygote_host_impl_linux.cc(107)] No usable sandbox! Update your kernel or see https://chromium.googlesource.com/chromium/src/+/master/docs/linux_suid_sandbox_development.md for more information on developing with the SUID sandbox. If you want to live dangerously and need an immediate workaround, you can try using --no-sandbox.
I passed --no-sandbox in chrome-launcher.js and it re-run the lighthouse command and it worked fine.
Changes to chrome-launcher.js
const flags = [
--remote-debugging-port=${this.port}
,
'--no-sandbox', //added no sandbox option
]
How to provide this flag as an option from lighthouse cli? or How to overcome the issue mentioned above.
Copied from original issue: GoogleChrome/lighthouse#1799
Breaking this out from #38 where we explored this the most. cc @ragingwind
Here is the node module API implemented in #38 (let's call this JS vAlpha API):
chromeLauncher.defaultFlags() // array of all the flags it uses by default
chromeLauncher.launch({
ignoreDefaultFlags: true, // will not supply any defaults.. the ones passed in below are it.
chromeFlags: [] // array of the only flags to use
});
and a CLI vAlpha API:
chrome-launcher --list-flags # prints and quits: '--disable-extensions --disable-translate-service ....'
chrome-launcher # launches with default flags
chrome-launcher --set-flags="--show-paint-rects --disable-extensions" # skips default flags and only uses provided ones
# naming: maybe "override-flags" to indicate this may break things..
# also allow just augmenting default flags with --add-flags
chrome-launcher --add-flags="--show-paint-rects"
# (this behavior is what lighthouse's current --chrome-flags arg does)
From @ghost on June 28, 2017 14:23
Greetings,
So, we're doing some unit testing of an application. One of such test is to launch a Chrome instance, run some JavaScript to close Chrome. After that, we have to test whether or not the Chrome is actually closed.
In current implementation of chrome-launcher
, it's very hard to do so because there is no callback which will indicate a passive Chrome shutdown.
However, it seems that the child_process
module is actually support exit
event, so maybe it's possible to add a callback to notify the Chrome instance is gone?
Copied from original issue: GoogleChrome/lighthouse#2609
I have this:
const cl = require('chrome-launcher');
const util = require('util');
cl.launch({
startingUrl: `http://yahoo.com`,
chromeFlags: ['--auto-open-devtools-for-tabs', '--debug-devtools'],
enableExtensions: true
})
.then(c => {
console.log(util.inspect(c));
// const url = c.getWebSocketServerUrl()
});
I am looking to get access to the url of the websocket server in the browser to connect to,
note that if I use these chrome flags
chromeFlags: ['--auto-open-devtools-for-tabs', '--remote-debugging-port=9222'],
the Promise callback will never fire with the above chrome flags!
if you look at this issue:
puppeteer/puppeteer#1788
the way to get the remote debugging url, is with:
https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#browserwsendpoint
browser.wsEndpoint()
returns: Browser websocket url.
Browser websocket endpoint which can be used as an argument to puppeteer.connect. The format is ws://${host}:${port}/devtools/browser/
my question is: is there a way to retrieve the remote debugging url given a launched chrome instance using chrome-launcher if we use the '--remote-debugging-port=9222' flag?
From @samccone on May 26, 2017 0:44
for example
https://github.com/karma-runner/karma-chrome-launcher
could easily use our launcher. :)
Copied from original issue: GoogleChrome/lighthouse#2369
from GoogleChrome/lighthouse#910:
Running lighthouse currently on an android phone is pretty tedious.
Ideally a user should be able to run lighthouse and pick a connected android phone to run chrome on and run the selected audits.
Implementations steps.
adb devices -l
to get the connected devicesadb forward tcp:9222 localabstract:chrome_devtools_remote
I think we could exclude support for multiple devices for the moment. I personally get nervous to have multiple devices connected over adb and trust that the right commands will go to the right phone, so I always unplug the one i'm not working with. But if you'd rather keep it in scope, then sure. :)
How do you want to handle getting a clean baseline? Clean chrome profile? Can we do user-data-dir via flag on android? Do we only use Canary and say "We'll be wiping your storage and SWs, FYI!"?
From @bliu23 on July 18, 2017 16:44
Chrome Launcher does not support Node v4.8.1 nor does it support ES5. Are there plans for this or are there any workarounds for applications written in ES5?
Copied from original issue: GoogleChrome/lighthouse#2708
Reported by @jayflux
CHROME_PATH=/usr/bin/google-chrome
NODE_EXTRA_CA_CERTS=/etc/pki/tls/certs/ca-bundle.crt
_=/usr/bin/env
[developer@sounds-performance sounds-performance]$ sudo -E node index.js
which: no chromium-browser in (/sbin:/bin:/usr/sbin:/usr/bin)
which: no chromium in (/sbin:/bin:/usr/sbin:/usr/bin)
{ Error: connect ECONNREFUSED 127.0.0.1:33429
at Object._errnoException (util.js:1024:11)
at _exceptionWithHostPort (util.js:1046:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)
code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 33429 }
[developer@sounds-performance sounds-performance]$
google-chrome
installed via YUM on centos 7. chrome-finder is failing to locate it.CHROME_PATH
setting doesn't seem to fix things.Going to add links to original lighthouse PRs into the commit messages.
Hello
I was trying to run Rendertron using npm start in an AWS ec2 instance to avoid the docker container performance penalty.
then I got this error after npm start
[email protected] start /home/ec2-user/rendertron
node src/main.js
{ Error: connect ECONNREFUSED 127.0.0.1:33465
at Object._errnoException (util.js:1026:11)
at _exceptionWithHostPort (util.js:1049:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1174:14)
code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 33465 }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: node src/main.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
The root of the problem was the isDebuggerReady() {} in chrome launcher. It seems that net.createConnection can never properly create a connection.
However, everything is running fine locally.
any ideas how to fix it?
start an AWS ec2 instance with AMI
connect to the ec2 instance
install git sudo yum install git
pull rendertron repo
git clone https://github.com/GoogleChrome/rendertron.git
install chrome
sudo yum --nogpgcheck localinstall https://intoli.com/blog/installing-google-chrome-on-centos/google-chrome-stable-60.0.3112.113-1.x86_64.rpm
cd into rendertron folder cd rendertron
npm install
npm start
yield this.waitUntilReady();
in chrome-launcher.js
in the spawnProcess
function. Rendertron was able to run, but if I try to render a page, it will give the following error.Uncaught exception
{ Error: connect ECONNREFUSED 127.0.0.1:38585
at Object._errnoException (util.js:1026:11)
at _exceptionWithHostPort (util.js:1049:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1174:14)
code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 38585 }
Thanks!
Component | Version |
---|---|
Operating system | Debian GNU/Linux buster/sid |
Node.js | v8.4.0 |
Chrome/Chromium/... | 61.0.3163.91 |
in the readme, it doesn't look like there is an option to open a new window in chrome or just a new tab
last time I looked in the codebase, I believe it defaults to opening a new tab (it tries it's best to).
is there some flag to force opening a new window? should that be documented?
I see that chrome-launcher
allows us to kill the browser. However if the browser closes itself (window.close()
I believe it is), is there a way to listen for when the browser process ends using this library?
From @paulirish on January 6, 2017 0:4
Our SIGINT handling is only in place in bin.ts
but chrome-launcher.ts
and manual-chrome-launcher.js
don't have it.
Copied from original issue: GoogleChrome/lighthouse#1420
According to GoogleChrome/lighthouse#4192 it looks like #69 did break typings resolution.
How can I tell chrome-launcher to launch the Canary version of Chrome, if I have more than one version of Chrome installed on a machine?
Hey all, looks like puppeteer will stop at breakpoints/debugger statements if devTools
is set to true:
https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions
Is there a way to do the same thing with chrome-launcher, or should I use puppeteer instead? I am not even sure what the difference is between puppeteer
and chrome-launcher
, would be nice for a brief compare and contrast in the README?
I have a use case where I need to launch Chrome with a different "TZ" variable than the one the environment is running under.
While I can do this in my launching Node process, it would make my script easier if I had a way to pass TZ into the launcher.
If you accept env as a launcher option, it would then get passed along into spawn command here: https://github.com/GoogleChrome/chrome-launcher/blob/master/chrome-launcher.ts#L220
Format of env argument could be something like this for example:
env: { 'TZ': 'America/New_York'}
Is it possible to launch chrome without creating a new userDataDir
?
From what I read in the documentation I will have to pass the user's current userDataDir
as part of the launch options but that doesn't look OK to me. The developer will have to detect the platform and user name to generate the right path (C:\Users\<username>\AppData\Local\Google\Chrome\User Data\Default
, Users/<username>/Library/Application Support/Google/Chrome/Default
, /home/<username>/.config/google-chrome/default
, for example).
The scenario I have in mind is to easily allow automation of some pages behind authentication if the user is already authenticated in there, for example.
Will you be open to have something to enable this? If so, what would be your preferred option? New parameter? Special value in userDataDir
(maybe default
)?
there was --disable-save-password-bubble which has been apparently removed: https://bugs.chromium.org/p/chromedriver/issues/detail?id=1015
also I can see no option to set prefs as suggested in the above link
From @alekseykulikov on August 24, 2017 9:17
Currently pollInterval = 500 ms
and pollRetries = 10
are hard-coded. It means, that launcher waits approximately 5s and then fails.
Sometimes, this is time not enough to start a Chrome, especially on slow machines or first boot inside new env.
I'd like to provide a PR, but first I'd like to hear feedback, should it be only pollRetries
or both.
Copied from original issue: GoogleChrome/lighthouse#3110
I need to run multiple headless chrome instances in parallel in order to efficiently generate output by processing DOM information from Jupyter notebooks. Each headless chrome instance is launched by executing the following method:
function launchChrome() {
return chromeLauncher.launch({
port: 9222,
autoSelectChrome: true,
chromeFlags: [
'--headless',
'--disable-gpu',
'--no-sandbox',
'--allow-running-insecure-content',
'--window-size=1750,1100',
'--enable-experimental-web-platform-features',
'--hide-scrollbars',
],
// Uncomment to receive logging from the headless chrome launcher itself
logLevel: 'verbose'
});
Additionally, I attach an instance of chrome-remote-interface to each headless chrome instance in order to access the DOM and each instance points to the URL specified in urlName by executing:
Page.navigate({ url: urlName });
When I try to execute my nodejs script which launches an instance of headless chrome as so:
/usr/local/bin/n use 8.8.1 /home/ubuntu/notebook_server/notebook/services/reporting/js/report.js <urlName>
two times with two different URL's the output of the first command coming from the chrome launcher is
ChromeLauncher No debugging port found on port 9222, launching a new Chrome. +0ms
ChromeLauncher:verbose created /tmp/lighthouse.nR4usdT +6ms
ChromeLauncher:verbose Launching with command:
ChromeLauncher:verbose "/usr/bin/google-chrome" --disable-translate --disable-extensions --disable-background-networking --safebrowsing-disable-auto-update --disable-sync --metrics-recording-only --disable-default-apps --no-first-run --remote-debugging-port=9222 --user-data-dir=/tmp/lighthouse.nR4usdT --disable-setuid-sandbox --headless --disable-gpu --no-sandbox --allow-running-insecure-content --window-size=1750,1100 --enable-experimental-web-platform-features --hide-scrollbars about:blank +15ms
ChromeLauncher:verbose Chrome running with pid 1472 on port 9222. +2ms
ChromeLauncher Waiting for browser. +1ms
ChromeLauncher Waiting for browser... +0ms
ChromeLauncher Waiting for browser..... +503ms
ChromeLauncher Waiting for browser.....โ +1ms
Default extension for cell metadata editing loaded.
Raw Cell Format toolbar preset loaded.
Slideshow extension for metadata editing loaded.
Session: kernel_created (0c44f3ce-925b-4b12-bfba-69eacb2b8b57)
Starting WebSockets:
{ pageHeight: 1100 }
Kernel: kernel_connected (5ac7d8ed-cf58-41b9-a58f-cb583df1d8cb)
Kernel: kernel_ready (5ac7d8ed-cf58-41b9-a58f-cb583df1d8cb)
and the output of the second command is:
Default extension for cell metadata editing loaded.
Raw Cell Format toolbar preset loaded.
Slideshow extension for metadata editing loaded.
Session: kernel_created (0c44f3ce-925b-4b12-bfba-69eacb2b8b57)
Starting WebSockets:
{ pageHeight: 1100 }
Kernel: kernel_connected (5ac7d8ed-cf58-41b9-a58f-cb583df1d8cb)
Kernel: kernel_ready (5ac7d8ed-cf58-41b9-a58f-cb583df1d8cb)
going to check if all iframes are rendered again in 3 seconds
still waiting on some iframes
Default extension for cell metadata editing loaded.
Raw Cell Format toolbar preset loaded.
Slideshow extension for metadata editing loaded.
Session: kernel_created (a71ac924-f942-44ee-8b9e-a65f26fdf7af)
Starting WebSockets:
{ pageHeight: 2733 }
Kernel: kernel_connected (6105e198-23bc-4304-b678-d7cb33b4197c)
Kernel: kernel_ready (6105e198-23bc-4304-b678-d7cb33b4197c)
Indicating that the chrome that was launched by the second command is that same. Or is the output stream shared? Either way my DOM process code executes and completes from the first invocation but not the second. It just seems to hang.
Any chance you could enlighten me as to whether or not two headless chrome processes can run independently of each other?
Starting on build 14951 WSL supports opening windows applications from bash. This will be available for anyone in the next stable release of Windows in October 17th
Bash on Windows is becoming very popular and adding support to this will be great. We've had a few people run into this issue when using sonar.
I can probably look into adding this if no one else wants to ๐
we currently register the global binary on a global install of lighthouse. should we also expose it in launcher's bin
?
and how do we handle both packages conflicting with the name.
@samccone sez +1.
if some flag is set to a empty string chrome launcher doesnt add the error in staring chrome in the stack strace . Have included the sample code here since we are not setting proxy variable in our config an empty flag is being passed to chrome launcher . chrome fails to launch but this doesnt show up in the log .any work around for it so it shows up in error
try {
chromeInstance = await chromeLauncher.launch({
port: 9222,
chromeFlags: [
'--disable-gpu',
'--hide-scrollbars',
headless ? '--headless' : '',
config.proxy ? `--proxy-server=${config.proxy}` : '',
],
handleSIGINT: true,
});
logger.debug({
[logger.fields.description]: 'CHROME_LAUNCHED',
[logger.fields.object]: JSON.stringify(chromeInstance),
});
lock.releaseLock();
} catch (error) {
lock.releaseLock();
logger.warn({
[logger.fields.description]: 'ERROR_LAUNCHING_CHROME',
[logger.fields.stack_trace]: error.stack,
});
throw error;
}
}
From @mmanela on August 23, 2017 16:48
This is the same bug reported on karma-chrome-launcher. If you open chrome using the chrome-launcher from an admin process, it open as a "dead" browser tab.
REPRO
let launcher = require('chrome-launcher')
launcher.launch()
If I do the same steps from a non-admin command prompt this works.
Copied from original issue: GoogleChrome/lighthouse#3099
I am wondering if there is a way to launch Chrome using chrome-launcher, and have Chrome load an HTML file without having to make a request for the HTML from a server?
How can we do that? Please advise.
I understand the majority of users will want muted audio during automated testing, but in our case we are recording video of the browsers tests and would like to record any audio generated by the browser. I'm sure others with multimedia sites may need access to this functionality. Although audio can't easily be automatically tested for, it is useful and simpler to watch the automated test case videos to check functionality rather than having to manually test audio functionality separately.
As this flag is in the defaults, there appears to be no way to override the behaviour (short of forking the entire code).
Would it be possible to make this a non-default flag, as an option that defaults to true, or an --unmute-audio flag, that pops the --mute-audio from the defaults?
re: puppeteer/puppeteer#408 (comment)
if I use this:
cl.launch({
startingUrl: `http://localhost:${port}/suman_testing?data=${testData}`,
chromeFlags: ['--auto-open-devtools-for-tabs']
})
this chrome flag should tell the browser to pause at the first breakpoint / debugger; statement, but it doesn't seem to do that.
My Chrome version should be relatively new, any idea what the problem might be?
From @guilhermevrs on July 19, 2017 9:32
Initial URL: https://developers.google.com/web/tools/lighthouse/
Chrome Version: 61.0.3160.0
When lauching
./node_modules/.bin/lighthouse https://developers.google.com/web/tools/lighthouse/
I get the following:
ChromeLauncher Waiting for browser. +0ms
ChromeLauncher Waiting for browser... +2ms
ChromeLauncher Waiting for browser...โ +510ms
But a chrome canary window opens with three tabs untitled tabs. The first with the path of my chrome executable (e.g. file:///C:/Users/username/AppData/Local/Google/Chrome%20SxS/Application/61.0.3160.0) and the rest with about:blank
I can't open the DevTools on it.
I have tried to use remote debugging, but the "Inspected pages" shows nothing.
I have tried using programatically, but no luck either. Same results
Windows 7 x64
Lighthouse version: 2.2.1
Node version: 6.10.3
Copied from original issue: GoogleChrome/lighthouse#2711
From @paulirish on June 20, 2017 21:59
This is a bit of carryover from #2544. It was failing 100% of the time and now its more like 5%.
Example build: https://travis-ci.org/GoogleChrome/lighthouse/jobs/245116083
Things to note:
There might be still a bug on the travis/chrome side, but seems like we have room to handle this from within launcher. (port sniffing & retry logic?)
At the very least, more usable error messages and extra logging.
wdyt @samccone
edit: he said..
Copied from original issue: GoogleChrome/lighthouse#2556
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
See this commit here. chrome-finder should fall back to using lowercase R on platforms that don't support uppercase R.
I'm setting handleSIGINT: false
When i press ctrl + c chrome closes, which it shouldn't
Running on OSX High Sierra, Chrome 63.0.3239.108
From @joelgriffith on August 7, 2017 17:40
When launching Chrome (at 62) it prints the special "browser" target to connect to:
DevTools listening on ws://127.0.0.1:9222/devtools/browser/dce23e24-5a5b-4f89-a3f4-749d3ef70ea9
This target isn't exposed/discoverable anywhere else in the protocol due to this merge: https://chromium-review.googlesource.com/c/596719
It might be a good thing to expose to consumers so that they can attach to this special target and do commands at the browser-level
Copied from original issue: GoogleChrome/lighthouse#2865
From @patrickhulce on June 15, 2017 22:16
At one point we published the download-chrome.sh
script with lighthouse that was handy for downstreamers to use when running in CI. It might be a nice feature of chrome-launcher to provide a similar mechanism to download/install chrome cross platform as well.
Copied from original issue: GoogleChrome/lighthouse#2510
From @samccone on May 16, 2017 3:54
The common use-case for using lighthouse programmatically is to launch chrome with it.. right now that is a nested promise with a bit of clean up at the end... The reason for most of this work boils down to the need to pass port
from the launcher to lighthouse.. because of this I think it might be nice to do something like
flags.launchChrome = true;
return Lighthouse(url, flags, config);
Which would take care of killing and launching chrome.
Copied from original issue: GoogleChrome/lighthouse#2259
I have this:
chromeLauncher.launch({
enableExtensions: true,
startingUrl: 'chrome-extension://idbanmbeeadlaanhdemgngeooobbadde/dist/index.html'
})
.then(chrome => {
console.log(`Chrome debugging port running on ${chrome.port}`);
});
I get this:
any idea why it can't load the extension's page?
by the way, I am trying to open it in a new tab in an existing window, but it keeps opening in a new window, let me know if there is some way to try to force it to use a tab instead of a new window. thx.
--test-type=foo
has some interesting effects: https://cs.chromium.org/search/?q=kTestType%5Cb&type=cs
Need to collect its effects and make sure ALL users of chrome-launcher want these changes made.
Hi,
I was trying to import the chrome-launcher
using default import syntax like that:
import chromeLauncher from 'chrome-launcher';
However, when I tried using it I got an error messageL ReferenceError: chromeLauncher is not defined
.
Importing all of the modules contents works.
import * as chromeLauncher from 'chrome-launcher';
I suggest either explicitly stating in the documentation that the modules has to be imported with import all contents syntax or add support for the default import.
We have a CI environment at my company that does not have chrome nor allows apt-get install
on our machines, but docker is available for better isolation of these dependencies, but I see no documentation or support for Docker. This would be greatly appreciated. I'm trying to get a shell script put together that can achieve this by passing in as a CHROME_PATH
, which may be the best, most unobtrustive way to support it. I'm struggling to get it working though :/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.