Most of this was copied from https://github.com/karma-runner/karma-chrome-launcher/issues/107
Google Chrome headless should be reported as Google Chrome.
When Google Chrome is configured to run in headless mode, Karma reports it as Safari 0.0.0.
karma --version): Karma version: 1.5.0google-chrome --version): Google Chrome 57.0.2987.98karma.config.js filebrowsers: ['ChromeNoSandboxHeadless'],
customLaunchers: {
ChromeNoSandboxHeadless: {
base: 'Chrome',
flags: [
'--no-sandbox',
// See https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md
'--headless',
'--disable-gpu',
// Without a remote debugging port, Google Chrome exits immediately.
' --remote-debugging-port=9222',
],
},
},
Just run Karma and view any output where the browser name and version are visible.
I am seeing the same thing, but I get additional output. That says "executed 0 out of 0 disconnected". I am not sure if this is because I am running Chrome headless or something other issue due to my Karma configuration.
@madCoder24 I think that's related to another part of your config. The above config works just fine for me.
Yep, the user agent differs.
Regular Chrome:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36
Headless Chrome:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome Safari/537.36
Thanks for checking the UA @remcohaszing. Pull request opened upstream to fix this: https://github.com/ua-parser/uap-core/pull/228
@rogeriopvl This issue is back in version 3.0.0 of karma, but now it's detecting HeadlessChrome 0.0.0 instead of the real chrome version which should be 68
@Licen-it thanks for reporting. Will have a look ASAP.
Oh FYI i also noticed it's not detecting Linux version (i was detecting my mac version, but running the tests with jenkins on linux it wasn't) HeadlessChrome 0.0.0 (Linux 0.0.0)
Most helpful comment
Thanks for checking the UA @remcohaszing. Pull request opened upstream to fix this: https://github.com/ua-parser/uap-core/pull/228