-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathconfig.ts
90 lines (80 loc) · 2.45 KB
/
config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import { QuickPickItem } from "vscode";
interface PickItem extends QuickPickItem {
[propName: string]: any;
}
const platform = process.platform;
const chromeItem: PickItem = {
description: "Windows, Mac, Linux",
detail: "A fast, secure, and free web browser built for the modern web",
label: "Google Chrome",
standardName: platform === 'win32'
? 'chrome'
: (
platform === 'darwin'
? 'google chrome'
: 'google-chrome'
),
acceptName: ['chrome', 'google chrome', 'google-chrome', 'gc', '谷歌浏览器']
};
const chromiumItem: PickItem = {
description: "Mac",
detail: "A fast, secure, and free web browser built for the modern web",
label: "Google Chromium",
standardName: "Chromium",
acceptName: ['chromium']
};
const firefoxItem: PickItem = {
description: "Windows, Mac, Linux",
detail: "A fast, smart and personal web browser",
label: "Mozilla Firefox",
standardName: "firefox",
acceptName: ['firefox', 'ff', 'mozilla firefox', '火狐浏览器']
};
const firefoxDeveloperItem: PickItem = {
description: "Mac",
detail: "A fast, smart and personal web browser",
label: "Mozilla Firefox Developer Edition",
standardName: "FirefoxDeveloperEdition",
acceptName: ['firefox developer', 'fde', 'firefox developer edition']
};
const ieItem: PickItem = {
description: "Windows",
detail: "A slightly outdated browser",
label: "Microsoft IE",
standardName: "iexplore",
acceptName: ['ie', 'iexplore']
};
const edgeItem: PickItem = {
description: "Windows",
detail: "A modern browser aiming to replace ie",
label: "Microsoft Edge",
standardName: "MicrosoftEdge",
acceptName: ['edge', 'msedge', 'microsoftedge']
};
const safariItem: PickItem = {
description: "Mac",
detail: "A fast, efficient browser on Mac",
label: "Apple Safari",
standardName: "safari",
acceptName: ['safari']
};
const operaItem: PickItem = {
description: "Windows, Mac",
detail: 'A fast, secure, easy-to-use browser',
label: 'Opera',
standardName: 'opera',
acceptName: ['opera']
};
const browsers = [chromeItem, firefoxItem, operaItem];
if (process.platform === 'win32') {
browsers.push(ieItem);
browsers.push(edgeItem);
} else if (process.platform === 'darwin') {
browsers.push(safariItem);
browsers.push(chromiumItem);
browsers.push(firefoxDeveloperItem);
}
export default {
browsers: browsers,
app: 'open-in-browser'
};