GoogleChromeLabs / carlo

Web rendering surface for Node applications
Apache License 2.0
9.31k stars 309 forks source link

Solved: Is it possible to package with Chrome? #77

Closed ghost closed 5 years ago

ghost commented 5 years ago

I want my application to work for everyone, even with Chrome. Is it possible for me to package my application with Chrome, even though it defeats the purpose of carlo?

frankhale commented 5 years ago

I was also wondering this same thing. Would love if there is a way to package with Chrome so that people that have not installed it can easily run my apps.

ghost commented 5 years ago

I think that I've found a solution.

  1. Install chromium

    npm install chromium
  2. Add the executablePath option to carlo.launch([options]) and set it to chromium.path

    
    const carlo = require('carlo');
    + const chromium = require('chromium');

(async () => { // Launch the browser. const app = await carlo.launch({

  1. Package your application
    npx pkg index.js

🥳 You're done!

frankhale commented 5 years ago

Oh nice! Definitely gonna try this. Thank you!

ghost commented 5 years ago

Keep in mind that it hasn't been properly tested, just quickly tried.