Skip to content

node.js script to get name of default browser

milahu/default-browser-name

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

default-browser-name

node.js script to get name of default browser

demo

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

install

in your node.js project

npm install https://github.com/milahu/default-browser-name.git

related

jakub-g/x-default-browser and sindresorhus/default-browser
do the same job in a 50 KB bundle, we only need 2.5 KB

todo

  • test with different platforms and browsers
  • maybe remove | findstr in win32 code

license

project license is CC0-1.0

About

node.js script to get name of default browser

Resources

Stars

Watchers

Forks