MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / findInProgramFiles

Function findInProgramFiles

javascript/selenium-webdriver/firefox.js:434–446  ·  view source on GitHub ↗

* @param {string} file Path to the file to find, relative to the program files * root. * @return {!Promise<?string>} A promise for the located executable. * The promise will resolve to null if Firefox was not found.

(file)

Source from the content-addressed store, hash-verified

432 * The promise will resolve to {@code null} if Firefox was not found.
433 */
434function findInProgramFiles(file) {
435 let files = [
436 process.env['PROGRAMFILES'] || 'C:\\Program Files',
437 process.env['PROGRAMFILES(X86)'] || 'C:\\Program Files (x86)',
438 ].map((prefix) => path.join(prefix, file))
439 return io.exists(files[0]).then(function (exists) {
440 return exists
441 ? files[0]
442 : io.exists(files[1]).then(function (exists) {
443 return exists ? files[1] : null
444 })
445 })
446}
447
448/** @enum {string} */
449const ExtensionCommand = {

Callers 1

locateMethod · 0.85

Calls 2

mapMethod · 0.45
existsMethod · 0.45

Tested by

no test coverage detected