UNPKG

@vscode/js-debug-browsers

Version:

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

60 lines 2.1 kB
"use strict"; /*--------------------------------------------------------- * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ Object.defineProperty(exports, "__esModule", { value: true }); exports.DarwinFirefoxBrowserFinder = void 0; const util_1 = require("./util"); const darwinFinderBase_1 = require("./darwinFinderBase"); /** * Finds the Firefox browser on OS X. */ class DarwinFirefoxBrowserFinder extends darwinFinderBase_1.DarwinFinderBase { constructor() { super(...arguments); /** * @override */ this.wellKnownPaths = [ { path: '/Applications/Firefox.app/Contents/MacOS/firefox', quality: "stable" /* Stable */, }, { path: '/Applications/Firefox Developer Edition.app/Contents/MacOS/firefox', quality: "dev" /* Dev */, }, { path: '/Applications/Firefox Nightly.app/Contents/MacOS/firefox', quality: "canary" /* Canary */, }, ]; } async findAllInner() { const suffixes = ['/Contents/MacOS/firefox']; const defaultPaths = ['/Applications/Firefox.app']; const installations = await this.findLaunchRegisteredApps('Firefox[A-Za-z ]*.app', defaultPaths, suffixes); return (0, util_1.sort)(installations, this.createPriorities([ { name: 'Firefox.app', weight: 0, quality: "stable" /* Stable */, }, { name: 'Firefox Nightly.app', weight: 1, quality: "canary" /* Canary */, }, { name: 'Firefox Developer Edition.app', weight: 2, quality: "dev" /* Dev */, }, ])); } getPreferredPath() { return this.env.FIREFOX_PATH; } } exports.DarwinFirefoxBrowserFinder = DarwinFirefoxBrowserFinder; //# sourceMappingURL=darwinFirefox.js.map