From 3c51cda873896e29c7ef729849a2960f56a32f42 Mon Sep 17 00:00:00 2001 From: CanadaHonk Date: Tue, 13 Dec 2022 20:07:11 +0000 Subject: [PATCH] gluworld: use args to select browsers, if not use default --- gluworld/index.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/gluworld/index.js b/gluworld/index.js index 19ee54c..07511f6 100644 --- a/gluworld/index.js +++ b/gluworld/index.js @@ -24,14 +24,19 @@ const dirSize = async dir => { }; (async () => { - const Chromium = await Gluon.open(pathToFileURL(join(__dirname, 'index.html')).href, { - windowSize: [ 800, 500 ], - forceBrowser: 'chrome_canary' - }); + if (process.argv.length > 2) { // use argv as browsers to use + for (const forceBrowser of process.argv.slice(2)) { + await Gluon.open(pathToFileURL(join(__dirname, 'index.html')).href, { + windowSize: [ 800, 500 ], + forceBrowser + }); + } - const Firefox = await Gluon.open(pathToFileURL(join(__dirname, 'index.html')).href, { - windowSize: [ 800, 500 ], - forceBrowser: 'firefox_nightly' + return; + } + + const Browser = await Gluon.open(pathToFileURL(join(__dirname, 'index.html')).href, { + windowSize: [ 800, 500 ] }); // const buildSize = await dirSize(__dirname);