-
Notifications
You must be signed in to change notification settings - Fork 34
/
aliases.js
83 lines (71 loc) · 2.6 KB
/
aliases.js
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
import path from 'path';
import BINARIES from './binaries';
const chromiumCmdArgs = [
'--disable-infobars',
'--disable-session-crashed-bubble',
'--no-first-run',
'--new-window',
'--disable-background-networking',
'--disable-ipc-flooding-protection',
'--disable-background-timer-throttling',
'--disable-backgrounding-occluded-windows',
'--autoplay-policy=no-user-gesture-required'
].join(' ');
const edgeCmdArgs = [
'--new-window',
'--disable-background-timer-throttling',
'--disable-backgrounding-occluded-windows'
].join(' ');
const ALIASES = {
'ie': {
nameRe: /iexplore|internet explorer/i,
cmd: ''
},
'firefox': {
nameRe: /firefox|mozilla/i,
cmd: `-override "${path.join(__dirname, '../data/override.ini')}" -new-window`,
macOpenCmdTemplate: 'open -a "{{{path}}}" {{{pageUrl}}} --args {{{cmd}}}',
linuxBinaries: ['firefox']
},
'chrome-canary': {
nameRe: /chrome\s*canary/i,
cmd: chromiumCmdArgs,
macOpenCmdTemplate: 'open -n -a "{{{path}}}" --args {{{pageUrl}}} {{{cmd}}}',
linuxBinaries: ['google-chrome-canary']
},
'chrome': {
nameRe: /chrome/i,
cmd: chromiumCmdArgs,
macOpenCmdTemplate: 'open -n -a "{{{path}}}" --args {{{pageUrl}}} {{{cmd}}}',
linuxBinaries: ['google-chrome', 'google-chrome-stable', 'google-chrome-unstable']
},
'chromium': {
nameRe: /chromium/i,
cmd: chromiumCmdArgs,
macOpenCmdTemplate: 'open -n -a "{{{path}}}" --args {{{pageUrl}}} {{{cmd}}}',
linuxBinaries: ['chromium-browser', 'chromium']
},
'opera': {
nameRe: /opera/i,
cmd: '--new-window',
macOpenCmdTemplate: 'open -n -a "{{{path}}}" --args {{{pageUrl}}} {{{cmd}}}',
linuxBinaries: ['opera']
},
'safari': {
nameRe: /safari/i,
cmd: '',
path: BINARIES.app,
macOpenCmdTemplate: `open -n -a "{{{path}}}" --args "${BINARIES.main}" /dev/null open {{{pageUrl}}} {{{cmd}}}`
},
'edge': {
nameRe: /edge/i,
cmd: edgeCmdArgs,
macOpenCmdTemplate: 'open -n -a "{{{path}}}" --args {{{pageUrl}}} {{{cmd}}}',
linuxBinaries: ['microsoft-edge']
},
'edge-legacy': {
cmd: '',
winOpenCmdTemplate: 'start microsoft-edge:"{{{pageUrl}}}"'
}
};
export default ALIASES;