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
This file contains 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
Possible Bug:
The mutation observer in bidi-mutation-listener.js only handles attribute changes and ignores other types of mutations such as childList or characterData. This might not meet the requirements if the intention was to handle all types of DOM mutations.
Performance Concern:
The mutation observer setup in bidi-mutation-listener.js may lead to performance issues for pages with high mutation rates since it observes all attributes changes, all character data changes, and all subtree modifications without any throttling or debouncing.
Code Quality:
In script.js, the method addDomMutationHandler uses a hardcoded file path which could lead to issues if the file structure changes or if executed in a different environment.
Use crypto.randomUUID() for generating unique IDs instead of Math.random()
To avoid potential issues with Math.random() generating non-unique IDs, consider using a more robust method for generating unique IDs, such as crypto.randomUUID().
Why: Adding error handling for file reading operations is crucial to prevent runtime errors and improve the robustness of the code.
7
Maintainability
Use a configuration or environment variable for the file path to improve flexibility
Instead of hardcoding the file path for bidi-mutation-listener.js, consider using a configuration or environment variable to make the path more flexible and maintainable.
Is some documentation how to use this functionality?
Perhaps it can be useful to web driver waits until DOM changing in the tree (like waitForAngular in the deprecated "Protractor" framework)
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.
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
Related to #13992.
Motivation and Context
Support dom-mutation using BiDi.
Types of changes
Checklist
PR Type
Enhancement, Tests
Description
Changes walkthrough 📝
bidi-mutation-listener.js
Add DOM mutation listener script
javascript/bidi-support/bidi-mutation-listener.js
script.js
Integrate DOM mutation listener in script management
javascript/node/selenium-webdriver/lib/script.js
webdriver_script_test.js
Add tests for DOM mutation handlers
javascript/node/selenium-webdriver/test/lib/webdriver_script_test.js
BUILD.bazel
Add build configuration for DOM mutation listener
javascript/bidi-support/BUILD.bazel
BUILD.bazel
Update build dependencies for DOM mutation listener
javascript/node/selenium-webdriver/BUILD.bazel
script.
BUILD.bazel
Add copy file rule for DOM mutation listener
javascript/node/selenium-webdriver/lib/atoms/BUILD.bazel