@eyeo/get-browser-binary 0.20.2 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitlab-ci.yml +21 -8
- package/.nvmrc +1 -0
- package/RELEASE_NOTES.md +15 -0
- package/package.json +3 -3
- package/src/browser.js +8 -2
- package/src/chromium.js +10 -2
- package/src/edge.js +9 -3
- package/test/docker/Dockerfile +1 -1
package/.gitlab-ci.yml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
default:
|
|
2
|
-
image: registry.gitlab.com/eyeo/docker/get-browser-binary:
|
|
2
|
+
image: registry.gitlab.com/eyeo/docker/get-browser-binary:node22
|
|
3
3
|
interruptible: true
|
|
4
4
|
|
|
5
5
|
stages:
|
|
@@ -49,31 +49,44 @@ test:browsers:linux:dev:
|
|
|
49
49
|
.windows:
|
|
50
50
|
stage: test
|
|
51
51
|
before_script:
|
|
52
|
-
- choco install -y microsoft-edge
|
|
53
52
|
- npm install
|
|
54
53
|
tags:
|
|
55
54
|
- eyeo-windows
|
|
56
55
|
cache: {}
|
|
57
|
-
# Retrying to mitigate Edge install issues
|
|
58
|
-
retry: 1
|
|
59
56
|
|
|
60
57
|
test:browsers:windows:
|
|
61
58
|
extends: .windows
|
|
62
59
|
script:
|
|
63
60
|
# Running Edge tests only on the preinstalled version
|
|
64
61
|
# https://gitlab.com/eyeo/developer-experience/get-browser-binary/-/issues/29
|
|
65
|
-
- npm test -- --grep "edge.*latest"
|
|
66
|
-
|
|
62
|
+
- npm test "--" --grep "edge.*latest"
|
|
63
|
+
# Chromium excluded until this is fixed: https://gitlab.com/eyeo/developer-experience/get-browser-binary/-/issues/87
|
|
64
|
+
# - npm test "--" --grep "^.*chromium((?!Version:.dev).)*$"
|
|
67
65
|
# Running only a subset of Firefox tests to avoid low OS resources error
|
|
68
66
|
# https://gitlab.com/eyeo/developer-experience/get-browser-binary/-/issues/2
|
|
69
|
-
|
|
67
|
+
# Firefox excluded until this is fixed: https://gitlab.com/eyeo/developer-experience/get-browser-binary/-/issues/87
|
|
68
|
+
# - npm test "--" --grep "firefox.*installs"
|
|
70
69
|
|
|
71
70
|
test:browsers:windows:dev:
|
|
72
71
|
extends: .windows
|
|
73
72
|
script:
|
|
74
|
-
- npm test -- --grep "chromium.*Version:.dev"
|
|
73
|
+
- npm test "--" --grep "chromium.*Version:.dev"
|
|
75
74
|
allow_failure: true
|
|
76
75
|
|
|
76
|
+
test:browsers:macos:
|
|
77
|
+
stage: test
|
|
78
|
+
tags:
|
|
79
|
+
- saas-macos-medium-m1
|
|
80
|
+
# https://docs.gitlab.com/ci/runners/hosted_runners/macos/#supported-macos-images
|
|
81
|
+
image: macos-15-xcode-16
|
|
82
|
+
cache: {}
|
|
83
|
+
before_script:
|
|
84
|
+
- npm install
|
|
85
|
+
script:
|
|
86
|
+
# Only checking that latest browsers can be installed on macOS
|
|
87
|
+
# Edge excluded until this is fixed: https://gitlab.com/eyeo/developer-experience/get-browser-binary/-/issues/88
|
|
88
|
+
- npm test -- -g "(chromium|firefox).*latest.*installs"
|
|
89
|
+
|
|
77
90
|
docs:
|
|
78
91
|
stage: docs
|
|
79
92
|
needs: []
|
package/.nvmrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
22.14.0
|
package/RELEASE_NOTES.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Unreleased
|
|
2
2
|
|
|
3
|
+
# 0.22.0
|
|
4
|
+
|
|
5
|
+
- Adds macOS CI job (!141)
|
|
6
|
+
- Temporarily skips failing Chromium and Firefox on Windows (!142)
|
|
7
|
+
- Disables local network access checks on Chromium v.139 (!143)
|
|
8
|
+
|
|
9
|
+
# 0.21.0
|
|
10
|
+
|
|
11
|
+
- Fixes an issue on Chromedriver (>=136) which stopped returning webdriver
|
|
12
|
+
handles for extension pages (!139)
|
|
13
|
+
- Fixes an issue on Firefox (>=138) when getting the installed version through
|
|
14
|
+
the binary file (#86)
|
|
15
|
+
- Updates the minimum supported version of Node to 22. Node 22 is the current
|
|
16
|
+
LTS version of Node (EXT-778)
|
|
17
|
+
|
|
3
18
|
# 0.20.2
|
|
4
19
|
|
|
5
20
|
- Fixes getting majorVersion on Edge (!133)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eyeo/get-browser-binary",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"description": "Install browser binaries and matching webdrivers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"author": "eyeo GmbH",
|
|
10
10
|
"license": "GPL-3.0",
|
|
11
11
|
"engines": {
|
|
12
|
-
"node": ">=
|
|
13
|
-
"npm": ">=
|
|
12
|
+
"node": ">=22",
|
|
13
|
+
"npm": ">=10"
|
|
14
14
|
},
|
|
15
15
|
"type": "module",
|
|
16
16
|
"main": "index.js",
|
package/src/browser.js
CHANGED
|
@@ -55,6 +55,12 @@ export class Browser {
|
|
|
55
55
|
* @throws {Error} Browser is not installed.
|
|
56
56
|
*/
|
|
57
57
|
static async getInstalledVersion(binary) {
|
|
58
|
+
// Since Firefox v138, calling `[firefox binary] --version` produces an
|
|
59
|
+
// EPERM error on the CI, even though the browser version is returned
|
|
60
|
+
// correctly. Ignoring that error as a workaround.
|
|
61
|
+
const ignoredError =
|
|
62
|
+
"Sandbox: CanCreateUserNamespace() clone() failure: EPERM";
|
|
63
|
+
|
|
58
64
|
try {
|
|
59
65
|
let stdout;
|
|
60
66
|
let stderr;
|
|
@@ -67,8 +73,8 @@ export class Browser {
|
|
|
67
73
|
else {
|
|
68
74
|
({stdout, stderr} = await promisify(execFile)(binary, ["--version"]));
|
|
69
75
|
}
|
|
70
|
-
if (stderr)
|
|
71
|
-
throw new Error(stderr);
|
|
76
|
+
if (stderr && !stderr.includes(ignoredError))
|
|
77
|
+
throw new Error(JSON.stringify({stdout, stderr}, null, 2));
|
|
72
78
|
|
|
73
79
|
return stdout.trim();
|
|
74
80
|
}
|
package/src/chromium.js
CHANGED
|
@@ -236,12 +236,20 @@ export class Chromium extends Browser {
|
|
|
236
236
|
await Chromium.#getInstalledBrowserInfo(customBrowserBinary) :
|
|
237
237
|
await Chromium.installBrowser(version, downloadTimeout);
|
|
238
238
|
|
|
239
|
-
|
|
239
|
+
const majorVersion = getMajorVersion(versionNumber);
|
|
240
|
+
const chromeOptions = {};
|
|
241
|
+
// https://issues.chromium.org/issues/409441960
|
|
242
|
+
if (majorVersion >= 136)
|
|
243
|
+
chromeOptions.enableExtensionTargets = true;
|
|
244
|
+
|
|
245
|
+
const options = new chrome.Options({"goog:chromeOptions": chromeOptions})
|
|
246
|
+
.addArguments("no-sandbox", ...extraArgs);
|
|
240
247
|
if (extensionPaths.length > 0) {
|
|
241
248
|
await checkExtensionPaths(extensionPaths);
|
|
242
249
|
options.addArguments(`load-extension=${extensionPaths.join(",")}`);
|
|
243
250
|
}
|
|
244
|
-
|
|
251
|
+
if (majorVersion >= 139)
|
|
252
|
+
options.addArguments("--disable-features=LocalNetworkAccessChecks");
|
|
245
253
|
if (headless) {
|
|
246
254
|
// https://www.selenium.dev/blog/2023/headless-is-going-away/
|
|
247
255
|
if (majorVersion >= 109)
|
package/src/edge.js
CHANGED
|
@@ -222,10 +222,16 @@ export class Edge extends Browser {
|
|
|
222
222
|
await Edge.getInstalledVersion(binary);
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
-
|
|
226
|
-
|
|
225
|
+
const majorVersion = getMajorVersion(versionNumber);
|
|
226
|
+
const edgeOptions = {};
|
|
227
|
+
// https://issues.chromium.org/issues/409441960
|
|
228
|
+
if (majorVersion >= 136)
|
|
229
|
+
edgeOptions.enableExtensionTargets = true;
|
|
230
|
+
|
|
231
|
+
const options = new edge.Options({"ms:edgeOptions": edgeOptions})
|
|
232
|
+
.addArguments("no-sandbox", ...extraArgs);
|
|
227
233
|
if (headless) {
|
|
228
|
-
if (versionNumber &&
|
|
234
|
+
if (versionNumber && majorVersion >= 114)
|
|
229
235
|
options.addArguments("headless=new");
|
|
230
236
|
else
|
|
231
237
|
options.addArguments("headless");
|
package/test/docker/Dockerfile
CHANGED