UNPKG

@vscode/js-debug-browsers

Version:

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

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