$ npm install xdg-default-browser
Get default browser on Linux
Issues with the output should be reported on the Debian, Freedesktop.org, KDE, Gnome, or corresponding issue trackers.
$ npm install --save xdg-default-browser
const xdgDefaultBrowser = require('xdg-default-browser');
xdgDefaultBrowser().then(browser => {
console.log(browser);
//=> {name: 'Google Chrome', id: 'google-chrome.desktop'}
});
MIT © Kevin Mårtensson
© 2010 - cnpmjs.org x YWFE | Home | YWFE