@aw-web-design/x-default-browser
Advanced tools
Comparing version 1.4.20 to 1.4.21
@@ -6,2 +6,10 @@ # Change Log | ||
## [1.4.21](https://github.com/The-Code-Monkey/TechStack/compare/@aw-web-design/x-default-browser@1.4.20...@aw-web-design/x-default-browser@1.4.21) (2022-05-19) | ||
**Note:** Version bump only for package @aw-web-design/x-default-browser | ||
## 1.4.20 (2022-05-19) | ||
@@ -8,0 +16,0 @@ |
{ | ||
"name": "@aw-web-design/x-default-browser", | ||
"version": "1.4.20", | ||
"version": "1.4.21", | ||
"description": "Detect default web browser of the current user, cross-platform (Win/Lin/Mac)", | ||
@@ -35,3 +35,3 @@ "license": "MIT", | ||
}, | ||
"gitHead": "28793a943c709ca945acce1b728917cdc61fea30" | ||
"gitHead": "ecd761a642904a7601bce763244c6263e0371f2f" | ||
} |
@@ -1,27 +0,24 @@ | ||
var defaultBrowserMac = require('default-browser-id'); | ||
const defaultBrowserId = import('default-browser-id'); | ||
module.exports = function (callback) { | ||
defaultBrowserMac(function (err, browserId) { | ||
if (err) { | ||
callback('Unable to retrieve default browser: ' + err); | ||
return; | ||
} | ||
module.exports = async function (callback) { | ||
const id = await defaultBrowserId.then(res => res.default()); | ||
var value = browserId; | ||
var valueLC = value.toLowerCase(); | ||
if (id) { | ||
const idLC = id.toLowerCase(); | ||
/* | ||
Safari com.apple.Safari | ||
Google Chrome com.google.chrome | ||
Opera com.operasoftware.Opera | ||
Firefox org.mozilla.firefox | ||
*/ | ||
var out = { | ||
Safari com.apple.Safari | ||
Google Chrome com.google.chrome | ||
Opera com.operasoftware.Opera | ||
Firefox org.mozilla.firefox | ||
*/ | ||
const out = { | ||
isIE: false, | ||
isSafari: valueLC.indexOf('safari') > -1, | ||
isFirefox: valueLC.indexOf('firefox') > -1, | ||
isChrome: valueLC.indexOf('google') > -1, | ||
isChromium: valueLC.indexOf('chromium') > -1, // untested | ||
isOpera: valueLC.indexOf('opera') > -1, | ||
identity: value, | ||
isSafari: idLC.indexOf('safari') > -1, | ||
isFirefox: idLC.indexOf('firefox') > -1, | ||
isChrome: idLC.indexOf('google') > -1, | ||
isChromium: idLC.indexOf('chromium') > -1, // untested | ||
isOpera: idLC.indexOf('opera') > -1, | ||
identity: id, | ||
}; | ||
@@ -33,3 +30,5 @@ out.isBlink = out.isChrome || out.isChromium || out.isOpera; | ||
callback(null, out); | ||
}); | ||
} else { | ||
callback('Unable to retrieve default browser'); | ||
} | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29125
17
498