-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[dotnet] Make FirefoxProfile AOT-safe
#14742
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
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.jsonfile, instead of parsing into aDictionary<string, object>This PR is a lot easier to read with whitespace disabled.
Motivation and Context
An open-typed
objectdictionary 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
FirefoxProfileto useJsonObjectinstead ofDictionary<string, object>, enhancing AOT safety.Preferencesclass to handle preferences usingJsonNode, improving type safety and performance.Changes walkthrough 📝
FirefoxProfile.cs
Refactor JSON Parsing to Use JsonObject for AOT Safetydotnet/src/webdriver/Firefox/FirefoxProfile.cs
DictionarywithJsonObjectfor JSON parsing.Preferences.cs
Update Preferences Handling with JsonNode and Nullabilitydotnet/src/webdriver/Firefox/Preferences.cs
JsonNode.SetPreferenceValueto handleJsonNode.