UNPKG

x-default-browser

Version:

Detect default web browser of the current user, cross-platform (Win/Lin/Mac)

18 lines (15 loc) 549 B
var detect; var os = require("os"); if (os.platform() == "win32") { // Windows 11 still returns 10.: https://stackoverflow.com/a/69922526/ if (os.release().indexOf("10.") === 0) detect = require("./lib/detect-windows10"); else detect = require("./lib/detect-windows"); } else if (os.platform() == "darwin") { detect = require("./lib/detect-mac"); } else if (os.platform() == "linux" || os.platform() == "freebsd") { detect = require("./lib/detect-linux"); } else { detect = require("./lib/detect-stub"); } module.exports = detect;