puppeteer-finder
Version:
Find a executable Chrome / Edge / Firefox in your system
33 lines • 1.1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const path_1 = require("path");
const utils_1 = require("./utils");
const prefixes = [
process.env.LOCALAPPDATA,
process.env.PROGRAMFILES,
process.env['PROGRAMFILES(X86)'],
];
const suffixes = [
'\\Chromium\\Application\\chrome.exe',
'\\Google\\Chrome\\Application\\chrome.exe',
'\\chrome-win32\\chrome.exe',
'\\Microsoft\\Edge\\Application\\msedge.exe',
'\\Google\\Chrome Beta\\Application\\chrome.exe',
'\\Microsoft\\Edge Dev\\Application\\msedge.exe',
'\\Google\\Chrome SxS\\Application\\chrome.exe',
'\\Microsoft\\Edge Canary\\Application\\msedge.exe',
];
function win32() {
const installations = [];
prefixes.forEach(prefix => suffixes.forEach(suffix => {
if (prefix) {
const chromePath = (0, path_1.join)(prefix, suffix);
if ((0, utils_1.canAccess)(chromePath)) {
installations.push(chromePath);
}
}
}));
return installations;
}
exports.default = win32;
//# sourceMappingURL=win32.js.map