diff --git a/package-lock.json b/package-lock.json index 6300ca5..807d2ca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "eslint-plugin-mozilla": "4.4.0", "eslint-plugin-no-unsanitized": "4.1.5", "jest": "^30.0.0", - "npm-run-all2": "9.0.2", + "npm-run-all2": "9.0.3", "prettier": "3.9.6", "rimraf": "6.1.3", "selenium-webdriver": "^4.20.0", @@ -7499,12 +7499,12 @@ } }, "node_modules/npm-run-all2": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/npm-run-all2/-/npm-run-all2-9.0.2.tgz", - "integrity": "sha512-+dd4SO2jAlLE06OzmJKzIe6QvvjXezcbmobnh8usR0a8BzQCABTdqTXqVPji0ICOhSQpIIrkGd7IzNl5iDaRSA==", + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/npm-run-all2/-/npm-run-all2-9.0.3.tgz", + "integrity": "sha512-BQAEdU1PtYc48qYRdghW2BVTQT3VqWCoFQmO87NlM1h1PYwMCKQpUWaNyB20V26caNzFsXQDfyOdznLlHCih6g==", "dev": true, "dependencies": { - "ansi-styles": "^6.2.1", + "ansi-styles": "^7.0.0", "cross-spawn": "^7.0.6", "memorystream": "^0.3.1", "picomatch": "^4.0.2", @@ -7525,12 +7525,12 @@ } }, "node_modules/npm-run-all2/node_modules/ansi-styles": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", - "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-7.0.0.tgz", + "integrity": "sha512-kKvt3m4uwzqL0wlkPd09CmljPJGOZZ4D0fP65sqFSvPkMRKhNi+74MgIJ5QxE6SxqB4t4KyUFGg8+n5zjo6hew==", "dev": true, "engines": { - "node": ">=12" + "node": ">=22" }, "funding": { "url": "https://github.com/chalk/ansi-styles?sponsor=1" @@ -7557,18 +7557,6 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/npm-run-all2/node_modules/shell-quote": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.10.0.tgz", - "integrity": "sha512-w1aiOKwKuRgtwAReIIj89puqg+I7GvX4IbLrvmhXbzQsj1+Zwi4VO3+fa6ZF91TWSjIxoEkKnMeHcLEODK5ZXA==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/npm-run-all2/node_modules/which": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/which/-/which-7.0.0.tgz", @@ -15933,12 +15921,12 @@ "dev": true }, "npm-run-all2": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/npm-run-all2/-/npm-run-all2-9.0.2.tgz", - "integrity": "sha512-+dd4SO2jAlLE06OzmJKzIe6QvvjXezcbmobnh8usR0a8BzQCABTdqTXqVPji0ICOhSQpIIrkGd7IzNl5iDaRSA==", + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/npm-run-all2/-/npm-run-all2-9.0.3.tgz", + "integrity": "sha512-BQAEdU1PtYc48qYRdghW2BVTQT3VqWCoFQmO87NlM1h1PYwMCKQpUWaNyB20V26caNzFsXQDfyOdznLlHCih6g==", "dev": true, "requires": { - "ansi-styles": "^6.2.1", + "ansi-styles": "^7.0.0", "cross-spawn": "^7.0.6", "memorystream": "^0.3.1", "picomatch": "^4.0.2", @@ -15949,9 +15937,9 @@ }, "dependencies": { "ansi-styles": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", - "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-7.0.0.tgz", + "integrity": "sha512-kKvt3m4uwzqL0wlkPd09CmljPJGOZZ4D0fP65sqFSvPkMRKhNi+74MgIJ5QxE6SxqB4t4KyUFGg8+n5zjo6hew==", "dev": true }, "isexe": { @@ -15966,12 +15954,6 @@ "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", "dev": true }, - "shell-quote": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.10.0.tgz", - "integrity": "sha512-w1aiOKwKuRgtwAReIIj89puqg+I7GvX4IbLrvmhXbzQsj1+Zwi4VO3+fa6ZF91TWSjIxoEkKnMeHcLEODK5ZXA==", - "dev": true - }, "which": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/which/-/which-7.0.0.tgz", diff --git a/package.json b/package.json index 2445a16..86a32a5 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "eslint-plugin-no-unsanitized": "4.1.5", "prettier": "3.9.6", "jest": "^30.0.0", - "npm-run-all2": "9.0.2", + "npm-run-all2": "9.0.3", "rimraf": "6.1.3", "selenium-webdriver": "^4.20.0", "web-ext": "10.5.0" diff --git a/tests/selenium.spec.js b/tests/selenium.spec.js index 0b596c4..06c924a 100644 --- a/tests/selenium.spec.js +++ b/tests/selenium.spec.js @@ -1,5 +1,9 @@ const { Browser, Builder, By } = require("selenium-webdriver"); -const { Context, Options } = require("selenium-webdriver/firefox"); +const { + Context, + Options, + ServiceBuilder, +} = require("selenium-webdriver/firefox"); const FirefoxProfile = require("firefox-profile"); const path = require("path"); @@ -23,9 +27,6 @@ beforeAll(async () => { options.setBinary(process.env.NIGHTLY_PATH || "/usr/bin/firefox-nightly"); options.addArguments("--pref 'extensions.experiments.enabled=true'"); options.addArguments("--headless"); - // Required to switch WebDriver into the privileged chrome context, which we - // use to resolve the extension's moz-extension:// URL below. - options.addArguments("-remote-allow-system-access"); options.setPreference("xpinstall.signatures.required", false); options.setPreference("extensions.experiments.enabled", true); options.setPreference( @@ -35,9 +36,16 @@ beforeAll(async () => { }), ); + // Switching WebDriver into the privileged chrome context (see below) requires + // system access. Firefox rejects `-remote-allow-system-access` when it is + // passed through capabilities, so it has to be enabled on the geckodriver + // process itself. + const service = new ServiceBuilder().addArguments("--allow-system-access"); + driver = await new Builder() .forBrowser(Browser.FIREFOX) .setFirefoxOptions(options) + .setFirefoxService(service) .build(); // install the addon