Skip to content

Commit 44ba3fe

Browse files
authored
test: enable Firefox 159 WebDriver system access via MOZ_REMOTE_ALLOW_SYSTEM_ACCESS (#47589)
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** **Problem** Some Firefox Selenium E2E test is failing during driver setup with UnsupportedOperationError: Navigation to "about:debugging#addons" is not allowed in this context. The cause is GitHub's new Ubuntu 24.04 runner image (ubuntu24/20261101.360), which upgraded the preinstalled Firefox from 158.0.1 to 159.0. Firefox 159 removed the --remote-allow-system-access command-line flag (Firefox bug 2054896). Our workaround from [#44946](#44946) and [#45014](#45014) relied on that flag, since geckodriver's --allow-system-access just passes it on to Firefox. Without system access, Firefox blocks navigation to about:debugging, where we read the extension's internal ID. The new image is still rolling out, so failures depend on which image a runner gets, not on branch changes. **Temp Fix** Set MOZ_REMOTE_ALLOW_SYSTEM_ACCESS=1 in the geckodriver service environment (test/e2e/webdriver/firefox.js). Firefox inherits it when geckodriver launches it. --allow-system-access stays in place so Firefox 158 and older keep working. I confirmed it locally with Firefox 159.0 and geckodriver 0.36.0: without the variable, Firefox throws the same error as CI; with it, about:debugging#addons loads. Eventually migrate to Playwright and use newer versions <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: ## **Related issues** Fixes: ## **Manual testing steps** 1. Check ci ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Test-only WebDriver bootstrap change with no production or user-facing impact. > > **Overview** > Fixes Firefox Selenium E2E setup on **Firefox 159+** (e.g. new Ubuntu 24.04 CI images), where navigation to `about:debugging#addons` fails because Mozilla removed the `--remote-allow-system-access` CLI flag that geckodriver used to pass through via `--allow-system-access`. > > The geckodriver service in `test/e2e/webdriver/firefox.js` now sets **`MOZ_REMOTE_ALLOW_SYSTEM_ACCESS=1`** on the service environment so Firefox inherits it at launch. **`--allow-system-access`** is unchanged for **Firefox 153–158**. Comments were updated to document both paths and link Mozilla bug 2054896. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit d8a3ab9. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent f693520 commit 44ba3fe

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎test/e2e/webdriver/firefox.js‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,18 @@ class FirefoxDriver {
166166
// `about:` pages, `chrome://`, `resource://`) unless system access is
167167
// allowed. `getInternalId` reads the extension UUID from
168168
// `about:debugging#addons`, so without this the session cannot start.
169-
// Newer geckodriver rejects `--remote-allow-system-access` via Firefox
170-
// capabilities; pass `--allow-system-access` to geckodriver instead.
169+
// - Firefox 153-158: geckodriver's `--allow-system-access` enables it by
170+
// forwarding `--remote-allow-system-access` to Firefox (geckodriver
171+
// rejects that flag when set via Firefox capabilities).
172+
// - Firefox 159+: that flag was removed; Firefox only reads the
173+
// `MOZ_REMOTE_ALLOW_SYSTEM_ACCESS` env var, inherited from geckodriver.
171174
// See https://bugzilla.mozilla.org/show_bug.cgi?id=1579790
175+
// See https://bugzilla.mozilla.org/show_bug.cgi?id=2054896
172176
service.addArguments('--allow-system-access');
177+
service.setEnvironment({
178+
...process.env,
179+
MOZ_REMOTE_ALLOW_SYSTEM_ACCESS: '1',
180+
});
173181

174182
if (port) {
175183
service.setPort(port);

0 commit comments

Comments
 (0)