Anyone tried Chromeless?

For some yet unsolved reason I can’t even import this thing into my Meteor app. I just get SyntaxError :cowboy_hat_face:

1 Like

Why would you want to do this?

For any purpose where I would like to programmatically control a browser.

Like, take an automated screenshot of my app, for example, or do some UI tests maybe?

1 Like

It’s a new project that some people are excited about, so I just thought I’d give it a try. Might be of use one day.

1 Like

I haven’t had a chance to use Chromeless, but I have used Chrome in headless mode.

One awesome use of headless Chrome is for integration testing. Now that headless Chrome is supported on Windows (via Chrome 60), we’re very close to pulling the trigger on getting rid of PhantomJS use in the Meteor test suite (#8659). Fingers crossed this will mean much fewer (random) test failures and less all round CI build bugginess!

1 Like

Sound cool – but I’d like to hear about more uses for this outside of testing. The screenshot idea is nice (but would you get this with headless I wonder?).

Thanks for the feedback. :slight_smile:

1 Like

Thanks @arggh. By the way, did you ever get that logging lib worked out? I know you were running into trouble/issues with it some time back.

I’ve been using FiLog ever since. It seems pretty solid, though not much activity recently on the repo.

So, to tie the Chromeless topic in with logging. Could the following be possible?

  1. Regular meteor app with headless chrome (Chromeless)
  2. User does something to cause an error
  3. Logging lib as usual caputures the error, but ALSO now uses Chromeless to take a screen capture of what the user was doing on the UI at the time of the error
  4. Stores this screenshot in S3 or on the filesystem

That is not possible.

Discalimer: There are some hacky ways of using a canvas element to capture the user’s screen and saving that as an image, but in general, this type of flow is prevented by browsers to protect their users.

What you can do:

  1. Have your app spawn a Chrome browser in the background (in headless mode)
  2. Tell that browser to do something, like:
  • go to
  • focus on first input
  • type “cat pics”
  • submit
  • click first link
  • take screenshot
1 Like

It’s like calling your best friend, “Hey mate, could you Google some cat pics for me and send 'em to me, thanks!”

But with this Chromeless-thingie, you could possibly have 10 000 friends and looooots of cat pics.

1 Like

Do me a favor and try it out!

Import Chromeless to your project and tell me how it works out.

meteor npm install --save chromeless

and in your server code:

import { Chromeless } from 'chromeless';

It wont work, because Chromeless requires node >= 6.10

You could also use chromeless to prerender apps that are still using Blaze. Just deployed it in couple of hours of fiddling. Works like charm!

Well that explains :slight_smile: I wish I’d get some kind of a warning, if Meteor’s node version and the node version required by the package I’m installing don’t quite match…

Cool! Can you provide how you implemented it with Blaze? A repo…thanks

It is already on my to-dolist!

1 Like

You can try updating to Meteor 1.6 beta, it uses node 8

1 Like

My 2c. If it’s for testing try Protractor with headless Chrome. There’s no way I’d go back to waiting for elements.