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

Function findInProgramFiles

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

336 * The promise will resolve to {@code null} if Firefox was not found.
337 */
338function findInProgramFiles(file) {
339 let files = [
340 process.env['PROGRAMFILES'] || 'C:\\Program Files',
341 process.env['PROGRAMFILES(X86)'] || 'C:\\Program Files (x86)',
342 ].map((prefix) => path.join(prefix, file))
343 return io.exists(files[0]).then(function (exists) {
344 return exists
345 ? files[0]
346 : io.exists(files[1]).then(function (exists) {
347 return exists ? files[1] : null
348 })
349 })
350}
351
352/** @enum {string} */
353const ExtensionCommand = {

Callers 1

locateMethod · 0.85

Calls 2

existsMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected