Closed ghost closed 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.
I think that I've found a solution.
Install chromium
npm install chromium
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({
executablePath: chromium.path, });
// Terminate Node.js process on app window closing. app.on('exit', () => process.exit());
// Tell carlo where your web files are located. app.serveFolder(__dirname);
// Expose 'env' function in the web environment. await app.exposeFunction('env', _ => process.env);
// Navigate to the main page of your app. await app.load('example.html'); })();
npx pkg index.js
🥳 You're done!
Oh nice! Definitely gonna try this. Thank you!
Keep in mind that it hasn't been properly tested, just quickly tried.
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
?