Skip to content

[js] Ensure BiDi is not exposed on driver - #17829

Draft
pujagani wants to merge 50 commits into
SeleniumHQ:trunkfrom
pujagani:bidi-access-js
Draft

[js] Ensure BiDi is not exposed on driver#17829
pujagani wants to merge 50 commits into
SeleniumHQ:trunkfrom
pujagani:bidi-access-js

Conversation

@pujagani

Copy link
Copy Markdown
Contributor

🔗 Related Issues

Related to #17814

💥 What does this PR do?

Ensure that BiDi connection is not accessible on driver.

🔧 Implementation Notes

🤖 AI assistance

  • No substantial AI assistance used
  • AI assisted (complete below)
    • Tool(s):
    • What was generated:
    • I reviewed all AI output and can explain the change

💡 Additional Considerations

🔄 Types of changes

  • Deprecation

@selenium-ci selenium-ci added the C-nodejs JavaScript Bindings label Jul 28, 2026
cgoldberg and others added 28 commits July 28, 2026 10:25
* [js] parse BiDi CDDL in generate_bidi.mjs, drop py/private merge_cddl dependency
… custom Firefox webExtension options (SeleniumHQ#17840)

* [build] add local CDDL overlays for webExtension.install SeleniumHQ#1140 extension point and moz vendor params

* [js] implement in schema not in merged cddl file that is sent to cddl2ts

* [rb] generate a browser-scoped webExtension vendor subclass (WebExtension::Moz)
…C URLs (SeleniumHQ#17790)

* [grid] honor client-advertised se:remoteUrl in the Node with grid-url precedence

* [grid] advertise se:remoteUrl from the language bindings

* [grid] fix se:remoteUrl on URL constructor, https scheme casing, and builder capability conflict

* [grid] strip se:remoteUrl from returned session caps

* [grid] use only the origin of se:remoteUrl for proxied URLs
…Q#17838)

* [rust] locate Chrome and Edge in known install directories

* [rust] honor --skip-browser-in-path and keep WebView2 out of Edge browser lookup
* [dotnet] throw instead of warn for CDP on Firefox

* [py] raise for CDP methods on Firefox

* [rb] remove CDP extensions from Firefox so methods are unavailable
… match severity (SeleniumHQ#17848)

* [rb] match log entries by id and severity, add missing log ids, drop logger stubs

* [rb] match message assertions against entries carrying multiple ids
* [rb] glob spec sources into //rb/spec:spec for rubocop and clear hidden offenses

* [rb] remove unnecessary rb_library from rb_integration_test now that //rb/spec:spec globs sources
…date primitives outbound in Ruby (SeleniumHQ#17852)

* [build] bump cddl to 0.21.1 so float BiDi ranges type as number, not integer

* [build] hoist nullable inline enums to named enums so their vocabulary is validated

* [rb] validate outbound BiDi primitive types at construction
…eleniumHQ#17853)

* [build] drop preserveExtras schema signal; extensibility alone gates wire extras

* [rb] retain wire extras on every extensible BiDi type, not only re-sendable ones

* [rb] keep extensible extras without warning and reject extras shadowing declared fields
…e map (SeleniumHQ#17855)

* [rb] raise typed WebDriver errors for BiDi from a generated error-code map

* [rb] declare RBS only for BiDi-only error classes to avoid redeclaring classic ones
…DEO_SESSION_SUBFOLDER (SeleniumHQ#17856)

Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
…SeleniumHQ#17859)

* [rb] add exception-aware pending_if guard matching

* [rb] keep pending_exception_guard spec deterministic under SKIP_PENDING
…LE is set (SeleniumHQ#17858)

[dotnet][java][py][rb] pass --enable-chrome-logs unless CHROME_LOG_FILE is set or on Windows (SeleniumHQ#16201)
…eleniumHQ#17862)

* [rb] add add_chromium_option/add_firefox_option escape hatches and merge hand-built vendor options

* [rb] normalize vendor option names to string keys
…eleniumHQ#17861)

* [rb] validate BiDi outbound ref fields against their declared type

* [rb] reject a non-variant object at a scalar-arm BiDi union

* [rb] validate BiDi union bare-scalar arms against their schema literals
…17863)

* [rb] capture log matcher output under SE_DEBUG and keep service specs env-agnostic

* [rb] drop the SE_DEBUG output lock in the spec log-capture helper
titusfortner and others added 21 commits August 2, 2026 22:55
… schema (SeleniumHQ#17864)

[bidi] derive per-type inbound/outbound directionality in the shared schema
Co-authored-by: Navin Chandra <navinchandra772@gmail.com>
…#17866)

* [build] test JavaScript on oldest and newest supported Node and publish on npm 11

* [build] run JavaScript unit tests on pull requests
Update pinned browser versions

Co-authored-by: Selenium CI Bot <selenium-ci@users.noreply.github.com>
* [build] regenerate CDP in the daily browser workflow if chrome stable version missing directory

* [build] run full Ruby tests on major browser PRs
…eniumHQ#17874)

* [js] wait for async BiDi log/mutation events and window resize in flaky tests

* [js] skip window resize polling on IE where getSize is approximate
…umHQ#17871)

* [dotnet][java][js][rb] deprecate dead Firefox profile members and add reuse specs
Update pinned browser versions

Co-authored-by: Selenium CI Bot <selenium-ci@users.noreply.github.com>
Co-authored-by: Titus Fortner <titusfortner@users.noreply.github.com>
…leniumHQ#17757)

* fix(rust): prevent empty driver version from being cached in metadata

Edge and Firefox cached empty driver_version in metadata when a
version-less HTTP response was received (e.g. misconfigured
driver-mirror-url or intercepting proxy). Chrome already guarded
against this with `!driver_version.is_empty()`. This change applies
the same guard to Edge and Firefox.

Also adds unit tests for previously untested pure logic:
- parse_version (version string parsing, error short-circuit, ESR/snap)
- get_index_version (major/minor/patch extraction, error cases)
- Version predicates (is_stable, is_beta, is_dev, is_nightly, is_esr,
  is_version_specific)
- get_major_version, get_major_browser_version
- str_to_os, OS::is, ARCH::is (config parsing)
- get_env_name (env var name generation)
- find_latest_from_cache, collect_files_from_cache
- is_driver_and_matches_browser_version (including empty-major bug)
- find_best_driver_from_cache (match, fallback, empty cache)

Tests document latent bugs: lexical sort misorders across digit
boundaries (9 vs 10), and starts_with("") matches all cached
drivers when major version is empty.

Fixes SeleniumHQ#17641

* fix: address Copilot review feedback

- Use manager's actual get_platform_label() instead of hardcoded
  values, so tests work on Apple Silicon (mac-arm64) and 32-bit
  Windows (win32)
- Rename get_major_version_errors_on_garbage to
  get_major_version_returns_first_component_for_non_numeric since
  the test asserts Ok, not Err

* fix(rust): address qodo review — add regression test for empty driver guard, fix i686 arch classification

- Add empty_driver_version_is_not_cached_in_metadata regression test that
  fails if the !driver_version.is_empty() guard is removed from edge.rs/firefox.rs
- Move i686 from ARCH::X64 to ARCH::X32 aliases in config.rs so
  get_normalized_arch() correctly returns ARCH_X86 for 32-bit systems
- Update config_unit_tests.rs to expect i686 under X32 and verify
  X64 does not match i686

* extract should_cache_driver_version helper for testable regression guard

* add doc comment to should_cache_driver_version

* fix(rust): address Qodo feedback - explicit as_str, remove unused rstest import, add ARCH docs

* fix: resolve CI formatting and test failures

- Fix rustfmt formatting in chrome.rs, edge.rs, firefox.rs (if-statement wrapping)
- Fix import ordering in config_unit_tests.rs and version_unit_tests.rs
- Fix collect_files_from_cache to filter files only, not directories
- Fix get_index_version to return error on empty string input

* style: apply go format changes to test files

- Reformat Apache license headers in cache_unit_tests.rs, config_unit_tests.rs, version_unit_tests.rs
- Reorder imports and collapse function signatures in cache_unit_tests.rs
- Collapse fs::write calls to single line
- Reformat get_driver_version_from_metadata call
…ions (SeleniumHQ#17875)

* [dotnet] support SE_*DRIVER environment variables to set driver locations

* [dotnet] make env-var driver path internal, log env-var driver source

* [dotnet] test env-var driver path via DriverProcessStarting event

---------

Co-authored-by: Nikolay Borisenko <22616990+nvborisenko@users.noreply.github.com>
SeleniumHQ#17815)

* [java] Fix By.className()/By.id() misescaping non-ASCII leading digits

PreW3CLocator.cssEscape (used by By.className/By.id, duplicated in
W3CHttpCommandCodec) used Character.isDigit() to detect a leading digit
needing CSS escaping. That accepts any Unicode decimal digit, not just
ASCII 0-9, so a leading non-ASCII digit (e.g. Arabic-Indic U+0665) got
rewritten using its numeric value as if it were the ASCII digit of the
same value, producing the same selector as an unrelated ASCII-digit
class/id (By.className("٥foo") collided with By.className("5foo")).

Per the CSS Syntax spec, "digit" is ASCII 0-9 only; non-ASCII code
points are already valid identifier-start characters and need no
escaping, so the fix narrows the check to the ASCII range instead of
adding new escaping logic.

* [java] Add direct regression coverage for W3CHttpCommandCodec.cssEscape

W3CHttpCommandCodec carries a byte-identical copy of the leading-digit
CSS-escape logic fixed in By.java, but had no test file exercising it
at all. ByTest/RemotableByTest only cover the By.java copy, since
By.toJson() pre-escapes client-side before anything reaches a command
codec, so a regression in this copy alone (e.g. from a future
de-duplication refactor) would go unnoticed.

Add W3CHttpCommandCodecTest exercising encode() for the "class name"/
"id" locator strategies directly, mirroring the ByTest cases. Verified
these tests fail against the pre-fix implementation and reproduce the
exact collision from the original report.

* [java] Use HttpRequest#contentAsString() instead of deprecated Contents.string in test

---------

Co-authored-by: Titus Fortner <titus.fortner@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-nodejs JavaScript Bindings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants