Skip to content

fix: do not update already set preference - #8692

Merged
AutomatedTester merged 2 commits into
SeleniumHQ:trunkfrom
yashLadha:fix_profile_update_python
Sep 15, 2020
Merged

fix: do not update already set preference#8692
AutomatedTester merged 2 commits into
SeleniumHQ:trunkfrom
yashLadha:fix_profile_update_python

Conversation

@yashLadha

@yashLadha yashLadha commented Sep 11, 2020

Copy link
Copy Markdown
Contributor

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

Inside the python binding we are reading from an already defined js file
for the frozen config and if user is trying to set those particular keys
in firefox profile, the changes aren't getting reflected. This leads to
a very inconsistent behavior on the user end.

We should not update the default preferences in the object if it is
already defined by the user using set_preferences and should do a key
check before storing it in the dict.

Motivation and Context

I was testing a javascript function behavior of window.open and wanted to open it in a new tab instead
of a window, and trying to set the config through firefox profile options but it was not being picked later
when did a little digging into the client binding code founded that we are overriding the values with some
set of frozen keys. Had to make those changes for it to work. So thought it might be beneficial for the
community as well.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Inside the python binding we are reading from an already defined js file
for the frozen config and if user is trying to set those particular keys
in firefox profile, the changes aren't getting reflected. This leads to
a very inconsistent behavior on the user end.

We should not update the default preferences in the object if it is
already defined by the user using `set_preferences` and should do a key
check before storing it in the dict.
@CLAassistant

CLAassistant commented Sep 11, 2020

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@AutomatedTester
AutomatedTester merged commit 5d850d9 into SeleniumHQ:trunk Sep 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants