xdg-default-browser

Get default browser on Linux

Usage no npm install needed!

<script type="module">
  import xdgDefaultBrowser from 'https://cdn.skypack.dev/xdg-default-browser';
</script>

README

xdg-default-browser Build Status

Get default browser on Linux

Issues with the output should be reported on the Debian, Freedesktop.org, KDE, Gnome, or corresponding issue trackers.

Install

$ npm install --save xdg-default-browser

Usage

const xdgDefaultBrowser = require('xdg-default-browser');

xdgDefaultBrowser().then(browser => {
    console.log(browser);
    //=> {name: 'Google Chrome', id: 'google-chrome.desktop'}
});

Related

License

MIT © Kevin Mårtensson