-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[dotnet] Make FirefoxProfile
AOT-safe
#14742
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Support for floating-point preferences has been added and the error message has been changed to reflect that. This PR is ready for another look! |
Thank you, @RenderMichael ! |
User description
Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Description
This PR hand-rolls parsing of the
webdriver_prefs.json
file, instead of parsing into aDictionary<string, object>
This PR is a lot easier to read with whitespace disabled.
Motivation and Context
An open-typed
object
dictionary is inherently AOT-unsafe. In this scenario, we know the expected structure of the JSON, so we can manually parse the values.Types of changes
Checklist
PR Type
enhancement
Description
FirefoxProfile
to useJsonObject
instead ofDictionary<string, object>
, enhancing AOT safety.Preferences
class to handle preferences usingJsonNode
, improving type safety and performance.Changes walkthrough 📝
FirefoxProfile.cs
Refactor JSON Parsing to Use JsonObject for AOT Safety
dotnet/src/webdriver/Firefox/FirefoxProfile.cs
Dictionary
withJsonObject
for JSON parsing.Preferences.cs
Update Preferences Handling with JsonNode and Nullability
dotnet/src/webdriver/Firefox/Preferences.cs
JsonNode
.SetPreferenceValue
to handleJsonNode
.