You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
py and dotnet stop reading third_party/js/selenium/webdriver.json for Firefox profile defaults and declare the supported preferences directly, the way Ruby already does
java drops the matching {frozen, mutable} parsing, which never had a file to read
🔧 Implementation Notes
The values are the ones Ruby has used since db06ba1; the rest of that file configured the legacy Firefox XPI driver or Firefox versions that no longer exist, which is why Ruby dropped them in e7b4b76
Each binding declares them rather than reading one shared file — java has no defaults to share and Ruby would need a new gem data file to read one, so converging would mean staging plumbing in three bindings for five constants; Ruby's profile_spec and the new py unit tests pin the values
The frozen/mutable split goes with it, and every preference that survives was already mutable, so nothing that could be overridden before stops being overridable:
dotnet — SetPreference no longer throws for the 45 frozen keys, none of which remain
py — already flattened both sections into one dict, so no change in what a caller can set
java — never had defaults at all; it passed Preferences an empty stub to satisfy a constructor, so that parsing and the constructors taking it go too
Ruby — unchanged, it is the reference
py keeps declaring startup.homepage_welcome_url rather than deriving it from the homepage, so an existing profile directory is still left untouched; java and dotnet already overwrite that preference themselves and are not touched
Only reached when a profile is set explicitly — py and dotnet both default to no profile and let geckodriver generate one
🤖 AI assistance
No substantial AI assistance used
AI assisted (complete below)
Tool(s): Claude Code (Opus 5)
What was generated: the cross-binding audit of what still reads the file, the changes, the tests, and this description
I reviewed all AI output and can explain the change
💡 Additional Considerations
Consider following up with PR removing unused things in third_party
The following are alternative approaches to this PR:
1. Generate binding constants from one canonical manifest
➕ Retains a single source of truth across supported bindings.
➕ Reduces the chance of preference values diverging over time.
➖ Requires generation and packaging plumbing for Python, .NET, Java, and Ruby.
➖ Java has no default set, while Python and .NET intentionally differ for welcome-page handling.
➖ Adds substantial machinery for only five shared constants.
Recommendation: Keep the PR's binding-local declarations. The small, stable preference set does not justify cross-language generation and packaging infrastructure, while focused tests can pin intended parity and binding-specific behavior.
Files changed (13) +96 / -160
Refactor (5) +25 / -122
FirefoxProfile.csDeclare supported Firefox defaults in .NET+10/-9
Declare supported Firefox defaults in .NET
• Replaces shared JSON deserialization with five binding-local default preferences. Existing profile preferences continue to be appended and remain overridable.
• Eliminates JSON-based initialization, immutable preference tracking, and override checks. All stored preferences can now be replaced through setters or appended profile values.
• Deletes constructors and parsing logic for frozen and mutable default maps. Reader-based construction now exclusively parses Firefox 'user.js' content.
firefox_profile.pyDeclare supported Firefox defaults in Python+9/-12
Declare supported Firefox defaults in Python
• Defines six default preferences directly on 'FirefoxProfile' and copies them for newly created profiles. This removes runtime JSON loading while preserving existing-profile and caller-override behavior.
• Adds tests for exact generated defaults, untouched existing profile directories, preservation of existing preferences, and caller overrides including the welcome URL.
CreateDefaultPreferences replaces the resource-backed preference set with five inline values, but
this PR adds no active C# unit test that verifies those defaults or their override behavior. The
only FirefoxProfileTests fixture is ignored at class level, so changes to the generated user.js
for new and existing profiles can regress without a binding test detecting them.
Compliance rule 5 requires focused unit coverage for applicable behavior changes. The changed C#
implementation introduces five inline defaults, while the repository's corresponding profile test
fixture is disabled with a class-level Ignore attribute and the PR adds no replacement C# test.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The new inline Firefox defaults and their override behavior have no active C# unit coverage because the existing Firefox profile test fixture is ignored.
## Fix Focus Areas
- dotnet/src/webdriver/Firefox/FirefoxProfile.cs[266-275]
- dotnet/test/webdriver/Firefox/FirefoxProfileTests.cs[23-108]
## Recommended Fix
Add an active focused unit test that creates a Firefox profile, writes it to disk, and verifies all five default preferences in `user.js`. Also verify that an explicit user preference overrides an inline default; place the tests in a runnable fixture rather than relying on the ignored class.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Context sources
Review mode: ⚖️ Balanced: This is a cross-binding behavioral change affecting Firefox profile preference generation and parsing across Python, .NET, and Java, with enough independent logic and compatibility implications to warrant a complete review.
Tip of the day
💡 Did you know, you can keep summaries lean with Finding overflow, which tucks the rest behind 'View more'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
B-buildIncludes scripting, bazel and CI integrationsC-dotnet.NET BindingsC-javaJava BindingsC-pyPython Bindings
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Related Issues
💥 What does this PR do?
third_party/js/selenium/webdriver.jsonfor Firefox profile defaults and declare the supported preferences directly, the way Ruby already does{frozen, mutable}parsing, which never had a file to read🔧 Implementation Notes
profile_specand the new py unit tests pin the valuesfrozen/mutablesplit goes with it, and every preference that survives was alreadymutable, so nothing that could be overridden before stops being overridable:SetPreferenceno longer throws for the 45 frozen keys, none of which remainPreferencesan empty stub to satisfy a constructor, so that parsing and the constructors taking it go toostartup.homepage_welcome_urlrather than deriving it from the homepage, so an existing profile directory is still left untouched; java and dotnet already overwrite that preference themselves and are not touched🤖 AI assistance
💡 Additional Considerations
Consider following up with PR removing unused things in
third_party🔄 Types of changes