MCPcopy Index your code
hub / github.com/SeleniumHQ/selenium / findInProgramFiles

Function findInProgramFiles

javascript/selenium-webdriver/firefox.js:433–445  ·  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

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

Callers 1

locateMethod · 0.85

Calls 3

joinMethod · 0.80
existsMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected