UNPKG

@vscode/js-debug-browsers

Version:

Browser launch and discovery logic used in VS Code's JavaScript Debugger

46 lines 1.68 kB
"use strict"; /*--------------------------------------------------------- * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ Object.defineProperty(exports, "__esModule", { value: true }); exports.WindowsFirefoxBrowserFinder = void 0; const path_1 = require("path"); const util_1 = require("./util"); const fs_1 = require("fs"); /** * Finds the Chrome browser on Windows. */ class WindowsFirefoxBrowserFinder { constructor(env = process.env, fs = fs_1.promises) { this.env = env; this.fs = fs; } async findWhere(predicate) { return (await this.findAll()).find(predicate); } async findAll() { const sep = path_1.win32.sep; const suffixes = [ { name: `${sep}Firefox Developer Edition${sep}firefox.exe`, type: "dev" /* Dev */, }, { name: `${sep}Firefox Nightly${sep}firefox.exe`, type: "canary" /* Canary */, }, { name: `${sep}Mozilla Firefox${sep}firefox.exe`, type: "stable" /* Stable */, }, ]; const installations = await (0, util_1.findWindowsCandidates)(this.env, this.fs, suffixes); const customFirefoxPath = await (0, util_1.preferredFirefoxPath)(this.fs, this.env); if (customFirefoxPath) { installations.unshift({ path: customFirefoxPath, quality: "custom" /* Custom */ }); } return installations; } } exports.WindowsFirefoxBrowserFinder = WindowsFirefoxBrowserFinder; //# sourceMappingURL=windowsFirefox.js.map