-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Issue 12549 fix atoms generation lowdash #15247
base: trunk
Are you sure you want to change the base?
Issue 12549 fix atoms generation lowdash #15247
Conversation
…xported function, also passing in entire window so that all pieces should have access to what they need.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
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.
Motivation and Context
The selenium atoms are used as part of the XCUITest iOS driver that is used in Appium, more specifically through appium-remote-debugger. The way they are currently generated is not working because of 2 issues, one where the window object passed in is not actually window, so it is missing some objects / properties that some atoms are expecting. The other issue is if window is actually used, it ends up overwriting "window._", causing projects that use lodash or underscore to break under automation.
This fix brings back using window itself, but also changes the exported function symbol to be something else so that "_" is not overwritten.
Types of changes
Checklist
Updated javascript/private/fragment.bzl file to use a new exported function name and also changed the wrapper to pass in window instead of just pieces of it. There is already a test added to verify injection of atoms clobbers "_" (selenium\java\test\org\openqa\selenium\AtomsInjectionTest.java), so I have not created any additional tests for this.
PR Type
Bug fix
Description
Fixed issue with atoms generation overwriting
window._
.Introduced
EXPORT_FUNCTION_NAME
to avoid conflicts with lodash/underscore.Updated wrapper to pass the entire
window
object for better compatibility.Changes walkthrough 📝
fragment.bzl
Refactored atoms export to avoid `window._` conflicts
javascript/private/fragment.bzl
EXPORT_FUNCTION_NAME
to define a unique exported function name.goog.exportSymbol
to useEXPORT_FUNCTION_NAME
.window
object.