sindresorhus / open

Open stuff like URLs, files, executables. Cross-platform.
MIT License
3.14k stars 213 forks source link

how to check chrome is installed #313

Open wideweide opened 1 year ago

wideweide commented 1 year ago

is there method to check chrome is installed in win and linux ? where chrome /chrome --version /google-chrome --version ,seems not very correctly

I have installed chrome in pop!os 's shop, but chrome --version/google-chrome --version output noting...

in windows: I have not install firefox, so not open url, but there is no error and some response to verify that it is correct

import open, { openApp, apps } from 'open';

async function test() {
    let res = await open(
        'https://cn.bing.com/',
        {
            app: {
                name: apps.chrome,
                arguments: [
                    '--app=https://cn.bing.com/',
                    '--window-size=800,600'
                ],
            },
            await: true,
            height: 800, width: 600
        }
    )
}

test()