-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
39 lines (32 loc) · 1.02 KB
/
index.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
'use strict'
const names = require('browser-names')
module.exports = function (name, version, platform) {
name = names.common(name) || name
version = version || version === 0 ? parseInt(version, 10) : Infinity
platform = platform || process.platform
if (name === 'chromium' || name === 'chrome' || name === 'edge') {
if (platform === 'win32') {
return version >= 60
} else {
return version >= 59
}
}
if (name === 'brave') {
// Version could be the product version (1.x) or Chromium version.
// Their Windows executables carry the Chromium version. Brave was on
// Chromium 70 well before its first stable release (1.0) so headless
// mode should work in theory. Return true until we hear otherwise.
return true
}
if (name === 'firefox') {
if (platform === 'darwin' || platform === 'win32') {
return version >= 56
} else {
return version >= 55
}
}
if (name === 'opera') {
// TBD. Currently shows a white window with --headless
}
return false
}