-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Closed as not planned
Labels
B-atomsJavaScript chunks generated by Google closureJavaScript chunks generated by Google closureI-defectSomething is not working as intendedSomething is not working as intendedJ-staleApplied to issues that become stale, and eventually closed.Applied to issues that become stale, and eventually closed.R-help wantedIssues looking for contributionsIssues looking for contributions
Description
What happened?
I generated find-element-fragment.js and pasted it into a browser. One line (minified it looks like the only line in the fragment that includes ba.JSON.stringify) seems to host this bug: ba is undefined.
Reading the minified code as best I can, it looks like ba is either document or window.navigator. Neither of these host the JSON global (it is on window, I think).
Removing ba. from the line so that it references JSON as a pure global fixes the issue.
I'm not sure how to navigate the whole Google Closure Compiler situation. A quick grep of the codebase for a fixable line only showed up goog.global.JSON. Perhaps this issue is internal to the Compiler?
How can we reproduce the issue?
1. Generate the fragment with `bazel build //javascript/webdriver/atoms/inject/...`
2. Copy the contents of the built `find-element-fragment.js` file into a browser console
3. Invoke the pasted contents as an IIFE with some params (like `'css selector', 'body'`)
4. Observe the errorRelevant log output
VM368:1631 Uncaught TypeError: Cannot read properties of undefined (reading 'stringify')
at Object.<anonymous> (<anonymous>:1631:26)
at findElement (<anonymous>:2633:8)
at <anonymous>:1:1Operating System
macOS
Selenium version
4.11.0
What are the browser(s) and version(s) where you see this issue?
Chrome, Safari
What are the browser driver(s) and version(s) where you see this issue?
N/A
Are you using Selenium Grid?
N/A
Metadata
Metadata
Assignees
Labels
B-atomsJavaScript chunks generated by Google closureJavaScript chunks generated by Google closureI-defectSomething is not working as intendedSomething is not working as intendedJ-staleApplied to issues that become stale, and eventually closed.Applied to issues that become stale, and eventually closed.R-help wantedIssues looking for contributionsIssues looking for contributions