node.js script to get name of default browser
const dbn = require('default-browser-name');
console.log(dbn());
console.log(dbn({raw:1}));sample result on linux
firefox
userapp-Firefox-PJ6A5Z.desktop
sample result on darwin (apple macos)
safari
com.apple.safari
sample result on windows 10
chrome
ChromeHTML
sample result on windows xp
launcher
C:\Program Files (x86)\Opera\launcher.exe
in your node.js project
npm install https://github.com/milahu/default-browser-name.gitjakub-g/x-default-browser and
sindresorhus/default-browser
do the same job in a 50 KB bundle, we only need 2.5 KB
- test with different platforms and browsers
- maybe remove
| findstrin win32 code
project license is CC0-1.0