diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml
index a308b6a649df9..ef1be3fa00e9a 100644
--- a/.github/ISSUE_TEMPLATE/bug-report.yml
+++ b/.github/ISSUE_TEMPLATE/bug-report.yml
@@ -50,7 +50,7 @@ body:
id: selenium-version
attributes:
label: What version of Selenium are you currently using?
- description: Important! The latest released version of Selenium is 4.33 and we can't fix old versions.
+ description: Important! The latest released version of Selenium is 4.34 and we can't fix old versions.
placeholder: e.g., 4.17.0
validations:
required: true
diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml
index b323609b13132..017ab6fa92eea 100644
--- a/.github/workflows/bazel.yml
+++ b/.github/workflows/bazel.yml
@@ -122,7 +122,7 @@ jobs:
node-version: ${{ inputs.node-version }}
- name: Setup Bazel with caching
if: inputs.caching
- uses: bazel-contrib/setup-bazel@0.13.0
+ uses: bazel-contrib/setup-bazel@0.15.0
with:
bazelisk-cache: true
bazelrc: common --color=yes
@@ -136,7 +136,7 @@ jobs:
repository-cache: true
- name: Setup Bazel without caching
if: inputs.caching == false
- uses: bazel-contrib/setup-bazel@0.13.0
+ uses: bazel-contrib/setup-bazel@0.15.0
with:
bazelrc: common --color=yes
- name: Setup curl for Ubuntu
diff --git a/.github/workflows/ci-grid-ui.yml b/.github/workflows/ci-grid-ui.yml
index 5bba8b9ed0b39..f9d1f145dbe76 100644
--- a/.github/workflows/ci-grid-ui.yml
+++ b/.github/workflows/ci-grid-ui.yml
@@ -25,7 +25,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
- node-version: '18'
+ node-version: '20'
cache: 'npm'
cache-dependency-path: 'javascript/grid-ui/package.json'
diff --git a/.github/workflows/ci-python.yml b/.github/workflows/ci-python.yml
index 2053b1c41ff9b..713ab6d884275 100644
--- a/.github/workflows/ci-python.yml
+++ b/.github/workflows/ci-python.yml
@@ -27,8 +27,8 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- pip install tox==4.25.0
- - name: Test with tox
+ pip install tox==4.27.0
+ - name: Generate docs
run: tox -c py/tox.ini
env:
TOXENV: docs
@@ -47,11 +47,10 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- pip install tox==4.25.0
- - name: Test with tox
+ pip install tox==4.27.0
+ - name: Run type checking
run: |
- tox -c py/tox.ini -- --cobertura-xml-report ci || true
- bash <(curl -s https://codecov.io/bash) -f py/ci/cobertura.xml
+ tox -c py/tox.ini || true
env:
TOXENV: mypy
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 00f86c98c0148..00e7031f760d9 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -25,7 +25,7 @@ jobs:
with:
fetch-depth: 50
- name: Setup Bazel
- uses: bazel-contrib/setup-bazel@0.13.0
+ uses: bazel-contrib/setup-bazel@0.15.0
with:
bazelisk-cache: true
cache-version: 2
diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml
index fb0f5a5045f0d..4417a12d9a839 100644
--- a/.github/workflows/pre-release.yml
+++ b/.github/workflows/pre-release.yml
@@ -93,7 +93,7 @@ jobs:
- name: Update browser versions
run: ./go update_browsers ${{ github.event.inputs.chrome_channel }}
- name: Commit browser updates
- run: git commit -m "update pinned browser versions"
+ run: git commit -m "update pinned browser versions" || true
- name: Update devtools versions
run: ./go all:update_cdp ${{ github.event.inputs.chrome_channel }}
- name: Commit DevTools updates
diff --git a/.gitignore b/.gitignore
index ac79481f1a206..d526bf6e42c0f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -75,6 +75,8 @@ py/selenium/webdriver/remote/getAttribute.js
py/selenium/webdriver/remote/isDisplayed.js
py/docs/build/
py/docs/source/**/*
+!py/docs/source/conf.py
+!py/docs/source/*.rst
py/build/
py/LICENSE
py/pytestdebug.log
diff --git a/.skipped-tests b/.skipped-tests
index 3262c35fda88a..91a20a0a5b629 100644
--- a/.skipped-tests
+++ b/.skipped-tests
@@ -5,6 +5,7 @@
-//java/test/org/openqa/selenium/edge:EdgeDriverFunctionalTest
-//java/test/org/openqa/selenium/edge:EdgeDriverFunctionalTest-edge
-//java/test/org/openqa/selenium/edge:EdgeDriverFunctionalTest-remote
+-//java/test/org/openqa/selenium/federatedcredentialmanagement:FederatedCredentialManagementTest
-//java/test/org/openqa/selenium/firefox:FirefoxDriverBuilderTest
-//java/test/org/openqa/selenium/grid/gridui:OverallGridTest
-//java/test/org/openqa/selenium/grid/router:RemoteWebDriverDownloadTest
diff --git a/AUTHORS b/AUTHORS
index 9c6f362fc95fb..30fcddbfaef5c 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -17,6 +17,7 @@ AdamPDotty <81536237+AdamPDotty@users.noreply.github.com>
Adi Roiban
adiohana
Aditya Pratap Singh
+Adolfo Armas
Adrian Dymorz
Adrian Leonhard
Agustin Pequeno <33221555+aguspe@users.noreply.github.com>
@@ -35,8 +36,10 @@ albertor24
Aleksei Moskvin
Alex <72409387+fergushev@users.noreply.github.com>
Alex
+Alex B <45384811+AB-xdev@users.noreply.github.com>
Alex Eagle
Alex Henrie
+Alex Popov
Alex Rodionov
Alex Savchuk
Alexander Bayandin
@@ -126,6 +129,7 @@ Boris Osipov
Boris Petrov
Boris Wrubel
bozdemir84
+Bradley Latreille <47356514+Bradltr95@users.noreply.github.com>
Branden Cash <203336+ammmze@users.noreply.github.com>
Brandon Walderman
Brandon Williams
@@ -368,6 +372,7 @@ Ilyas Bayraktar
Immanuel Hayden
Indomitable
Innokenty Shuvalov
+Ioan Giurgiu
Isaac A. Murchie
Isaul Vargas
Ish Abbi
@@ -547,6 +552,7 @@ Lucas Diniz
Lucas Tierney
Luis Correia
Luis Pflamminger
+Luis Serna
Luke Hill
Luke Inman-Semerau
lukec
@@ -802,6 +808,7 @@ Seth Lemanek
Seva Lotoshnikov
Shan
Shashank <42868640+snsten@users.noreply.github.com>
+Shaurya Bisht <87357655+ShauryaDusht@users.noreply.github.com>
Shay Dratler
Shengfa <3363396+k7z45@users.noreply.github.com>
shin
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 3c88ce7e33c76..3905abcb1d9e9 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -62,11 +62,11 @@ on Github.
This document will guide you through the contribution process.
-### Step 1: Fork
+### Step 1: Fork & Clone
Fork the project [on Github](https://github.com/seleniumhq/selenium)
-and check out your copy locally. Use `--depth 1` for a quick check out.
-The repository is ~2GB and checking the whole history takes a while.
+and clone the repository locally. Use `--depth 1` for a quick clone.
+The repository is over 2GB and cloning the whole history takes a while.
```shell
% git clone git@github.com:username/selenium.git --depth 1
@@ -76,7 +76,7 @@ The repository is ~2GB and checking the whole history takes a while.
#### Dependencies
-We bundle dependencies in the _third-party/_ directory that is not
+We bundle dependencies in the _third-party/_ directory that are not
part of the proper project. Any changes to files in this directory or
its subdirectories should be sent upstream to the respective projects.
Please don't send your patch to us as we cannot accept it.
diff --git a/MODULE.bazel b/MODULE.bazel
index 68994e475672f..b4406f4376ed2 100644
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -1,7 +1,6 @@
module(name = "selenium")
bazel_dep(name = "apple_rules_lint", version = "0.4.0")
-bazel_dep(name = "aspect_rules_lint", version = "1.4.2")
bazel_dep(name = "aspect_bazel_lib", version = "2.13.0")
bazel_dep(name = "aspect_rules_esbuild", version = "0.21.0")
bazel_dep(name = "aspect_rules_js", version = "2.3.7")
@@ -21,6 +20,7 @@ bazel_dep(name = "rules_cc", version = "0.1.1", dev_dependency = True)
bazel_dep(name = "rules_dotnet", version = "0.17.5")
bazel_dep(name = "rules_java", version = "8.7.1")
bazel_dep(name = "rules_jvm_external", version = "6.6")
+bazel_dep(name = "rules_multitool", version = "1.3.0")
bazel_dep(name = "rules_nodejs", version = "6.3.2")
bazel_dep(name = "rules_oci", version = "1.8.0")
bazel_dep(name = "rules_pkg", version = "1.0.1")
@@ -31,12 +31,16 @@ bazel_dep(name = "rules_ruby", version = "0.19.0")
# Until `rules_jvm_external` 6.8 ships
git_override(
module_name = "rules_jvm_external",
- commit = "d8af22108bd8b353a226140570008231f2921931",
+ commit = "29c451d2a62aa2451f5810c005ecac925b4772b6",
patch_strip = 1,
patches = ["//java:rules_jvm_external_javadoc.patch"],
remote = "https://github.com/bazel-contrib/rules_jvm_external.git",
)
+multitool = use_extension("@rules_multitool//multitool:extension.bzl", "multitool")
+multitool.hub(lockfile = "//:multitool.lock.json")
+use_repo(multitool, "multitool")
+
linter = use_extension("@apple_rules_lint//lint:extensions.bzl", "linter")
linter.configure(
name = "java-spotbugs",
@@ -171,7 +175,7 @@ maven.install(
name = "maven",
artifacts = [
"com.beust:jcommander:1.82",
- "com.github.javaparser:javaparser-core:3.26.4",
+ "com.github.javaparser:javaparser-core:3.27.0",
"com.github.spotbugs:spotbugs:4.9.3",
"com.github.stephenc.jcip:jcip-annotations:1.0-1",
"com.google.code.findbugs:jsr305:3.0.2",
@@ -183,8 +187,8 @@ maven.install(
"com.google.googlejavaformat:google-java-format:1.27.0",
"com.graphql-java:graphql-java:22.3",
"dev.failsafe:failsafe:3.3.2",
- "io.grpc:grpc-context:1.72.0",
- "io.lettuce:lettuce-core:6.6.0.RELEASE",
+ "io.grpc:grpc-context:1.73.0",
+ "io.lettuce:lettuce-core:6.7.1.RELEASE",
"io.netty:netty-buffer",
"io.netty:netty-codec-http",
"io.netty:netty-codec-http2",
@@ -202,12 +206,12 @@ maven.install(
"io.opentelemetry:opentelemetry-sdk-testing",
"io.opentelemetry:opentelemetry-sdk-trace",
"it.ozimov:embedded-redis:0.7.3",
- "net.bytebuddy:byte-buddy:1.17.5",
- "org.htmlunit:htmlunit-core-js:4.12.0",
- "org.apache.commons:commons-exec:1.4.0",
- "org.apache.logging.log4j:log4j-core:2.24.3",
+ "net.bytebuddy:byte-buddy:1.17.6",
+ "org.htmlunit:htmlunit-core-js:4.13.0",
+ "org.apache.commons:commons-exec:1.5.0",
+ "org.apache.logging.log4j:log4j-core:2.25.0",
"org.assertj:assertj-core:3.27.3",
- "org.bouncycastle:bcpkix-jdk18on:1.80",
+ "org.bouncycastle:bcpkix-jdk18on:1.81",
"org.eclipse.mylyn.github:org.eclipse.egit.github.core:2.1.5",
"org.hsqldb:hsqldb:2.7.4",
"org.jspecify:jspecify:1.0.0",
@@ -219,16 +223,18 @@ maven.install(
"org.junit.platform:junit-platform-commons",
"org.junit.platform:junit-platform-engine",
"org.mockito:mockito-core:5.18.0",
- "org.redisson:redisson:3.47.0",
+ "org.redisson:redisson:3.50.0",
"org.slf4j:slf4j-api:2.0.17",
"org.slf4j:slf4j-jdk14:2.0.17",
"org.tomlj:tomlj:1.1.1",
"org.zeromq:jeromq:0.6.0",
+ "uk.org.webcompere:system-stubs-jupiter:2.1.8",
+ "uk.org.webcompere:system-stubs-core:2.1.8",
],
boms = [
- "io.opentelemetry:opentelemetry-bom:1.50.0",
+ "io.opentelemetry:opentelemetry-bom:1.51.0",
"io.netty:netty-bom:4.1.121.Final",
- "org.junit:junit-bom:5.12.2",
+ "org.junit:junit-bom:5.13.2",
],
excluded_artifacts = [
"org.hamcrest:hamcrest-all", # Replaced by hamcrest 2
@@ -366,6 +372,8 @@ use_repo(
pin_browsers_extension = use_extension("//common:repositories.bzl", "pin_browsers_extension")
use_repo(
pin_browsers_extension,
+ "linux_beta_chrome",
+ "linux_beta_chromedriver",
"linux_beta_firefox",
"linux_chrome",
"linux_chromedriver",
@@ -373,6 +381,8 @@ use_repo(
"linux_edgedriver",
"linux_firefox",
"linux_geckodriver",
+ "mac_beta_chrome",
+ "mac_beta_chromedriver",
"mac_beta_firefox",
"mac_chrome",
"mac_chromedriver",
diff --git a/README.md b/README.md
index 3ca69b1ad1936..6411172f65dcc 100644
--- a/README.md
+++ b/README.md
@@ -15,8 +15,7 @@
Developing •
Testing •
Documenting •
- Releasing •
- License
+ Releasing
@@ -555,7 +554,3 @@ If you have access to the Selenium EngFlow repository, you can have the assets b
```shell
./go all:release['--config', 'release']
```
-
-## License
-
-Selenium's source code is made available under the [Apache 2.0 license](https://github.com/SeleniumHQ/selenium/blob/trunk/LICENSE).
diff --git a/Rakefile b/Rakefile
index 0746b9f06b583..d872ee283a0cf 100644
--- a/Rakefile
+++ b/Rakefile
@@ -97,7 +97,7 @@ JAVA_RELEASE_TARGETS = %w[
//java/src/org/openqa/selenium/chrome:chrome.publish
//java/src/org/openqa/selenium/chromium:chromium.publish
//java/src/org/openqa/selenium/devtools/v137:v137.publish
- //java/src/org/openqa/selenium/devtools/v135:v135.publish
+ //java/src/org/openqa/selenium/devtools/v138:v138.publish
//java/src/org/openqa/selenium/devtools/v136:v136.publish
//java/src/org/openqa/selenium/edge:edge.publish
//java/src/org/openqa/selenium/firefox:firefox.publish
@@ -963,9 +963,9 @@ namespace :java do
ENV['MAVEN_USER'] ||= ENV.fetch('SEL_M2_USER', nil)
ENV['MAVEN_PASSWORD'] ||= ENV.fetch('SEL_M2_PASS', nil)
read_m2_user_pass unless ENV['MAVEN_PASSWORD'] && ENV['MAVEN_USER']
-
- repo = nightly ? 'content/repositories/snapshots' : 'service/local/staging/deploy/maven2'
- ENV['MAVEN_REPO'] = "https://oss.sonatype.org/#{repo}"
+ repo_domain = 'central.sonatype.com'
+ repo = nightly ? "#{repo_domain}/repository/maven-snapshots" : "ossrh-staging-api.#{repo_domain}/service/local/"
+ ENV['MAVEN_REPO'] = "https://#{repo}"
ENV['GPG_SIGN'] = (!nightly).to_s
if nightly
@@ -1105,7 +1105,7 @@ namespace :all do
['common/devtools/',
'dotnet/src/webdriver/DevTools/',
- 'dotnet/src/webdriver/WebDriver.csproj',
+ 'dotnet/src/webdriver/Selenium.WebDriver.csproj',
'dotnet/test/common/DevTools/',
'dotnet/test/common/CustomDriverConfigs/',
'dotnet/selenium-dotnet-version.bzl',
diff --git a/common/browsers.bzl b/common/browsers.bzl
index 7be9d79fbf267..0617a80c934d4 100644
--- a/common/browsers.bzl
+++ b/common/browsers.bzl
@@ -83,3 +83,25 @@ firefox_beta_data = select({
],
"//conditions:default": [],
}) + geckodriver_data
+
+chromedriver_beta_data = select({
+ "@selenium//common:use_pinned_linux_chrome": [
+ "@linux_beta_chromedriver//:chromedriver",
+ ],
+ "@selenium//common:use_pinned_macos_chrome": [
+ "@mac_beta_chromedriver//:chromedriver",
+ ],
+ "@selenium//common:use_local_chromedriver": ["@selenium//common:chromedriver"],
+ "//conditions:default": [],
+})
+
+chrome_beta_data = select({
+ "@selenium//common:use_pinned_linux_chrome": [
+ "@linux_beta_chrome//:files",
+ "@linux_beta_chrome//:chrome-linux64/chrome",
+ ],
+ "@selenium//common:use_pinned_macos_chrome": [
+ "@mac_beta_chrome//:Chrome.app",
+ ],
+ "//conditions:default": [],
+}) + chromedriver_beta_data
diff --git a/common/devtools/chromium/v135/BUILD.bazel b/common/devtools/chromium/v138/BUILD.bazel
similarity index 100%
rename from common/devtools/chromium/v135/BUILD.bazel
rename to common/devtools/chromium/v138/BUILD.bazel
diff --git a/common/devtools/chromium/v135/browser_protocol.pdl b/common/devtools/chromium/v138/browser_protocol.pdl
similarity index 95%
rename from common/devtools/chromium/v135/browser_protocol.pdl
rename to common/devtools/chromium/v138/browser_protocol.pdl
index 46526d39dcbde..4dfad4def0eff 100644
--- a/common/devtools/chromium/v135/browser_protocol.pdl
+++ b/common/devtools/chromium/v138/browser_protocol.pdl
@@ -823,6 +823,7 @@ experimental domain Audits
ValidationFailedSignatureExpired
ValidationFailedInvalidLength
ValidationFailedSignatureMismatch
+ ValidationFailedIntegrityMismatch
# Details for issues around "Attribution Reporting API" usage.
# Explainer: https://github.com/WICG/attribution-reporting-api
@@ -858,6 +859,8 @@ experimental domain Audits
type SRIMessageSignatureIssueDetails extends object
properties
SRIMessageSignatureError error
+ string signatureBase
+ array of string integrityAssertions
AffectedRequest request
type GenericIssueErrorType extends string
@@ -980,6 +983,7 @@ experimental domain Audits
TypeNotMatching
UiDismissedNoEmbargo
CorsError
+ SuppressedBySegmentationPlatform
type FederatedAuthUserInfoRequestIssueDetails extends object
properties
@@ -1075,6 +1079,19 @@ experimental domain Audits
# The value of the property rule property that failed to parse
optional string propertyValue
+ type UserReidentificationIssueType extends string
+ enum
+ BlockedFrameNavigation
+ BlockedSubresource
+
+ # This issue warns about uses of APIs that may be considered misuse to
+ # re-identify users.
+ type UserReidentificationIssueDetails extends object
+ properties
+ UserReidentificationIssueType type
+ # Applies to BlockedFrameNavigation and BlockedSubresource issue types.
+ optional AffectedRequest request
+
# A unique identifier for the type of issue. Each type may use one of the
# optional fields in InspectorIssueDetails to convey more specific
# information about the kind of issue.
@@ -1105,6 +1122,7 @@ experimental domain Audits
SharedDictionaryIssue
SelectElementAccessibilityIssue
SRIMessageSignatureIssue
+ UserReidentificationIssue
# This struct holds a list of optional fields with additional information
# specific to the kind of issue. When adding a new issue code, please also
@@ -1135,6 +1153,7 @@ experimental domain Audits
optional SharedDictionaryIssueDetails sharedDictionaryIssueDetails
optional SelectElementAccessibilityIssueDetails selectElementAccessibilityIssueDetails
optional SRIMessageSignatureIssueDetails sriMessageSignatureIssueDetails
+ optional UserReidentificationIssueDetails userReidentificationIssueDetails
# A unique id for a DevTools inspector issue. Allows other entities (e.g.
# exceptions, CDP message, console messages, etc.) to reference an issue.
@@ -1481,6 +1500,7 @@ domain Browser
idleDetection
keyboardLock
localFonts
+ localNetworkAccess
midi
midiSysex
nfc
@@ -1532,6 +1552,7 @@ domain Browser
enum
openTabSearch
closeTabSearch
+ openGlic
# Set permission settings for given origin.
experimental command setPermission
@@ -1613,6 +1634,10 @@ domain Browser
inProgress
completed
canceled
+ # If download is "completed", provides the path of the downloaded file.
+ # Depending on the platform, it is not guaranteed to be set, nor the file
+ # is guaranteed to exist.
+ experimental optional string filePath
# Close browser gracefully.
command close
@@ -1740,6 +1765,25 @@ domain Browser
parameters
string url
+ experimental type PrivacySandboxAPI extends string
+ enum
+ BiddingAndAuctionServices
+ TrustedKeyValue
+
+ # Configures encryption keys used with a given privacy sandbox API to talk
+ # to a trusted coordinator. Since this is intended for test automation only,
+ # coordinatorOrigin must be a .test domain. No existing coordinator
+ # configuration for the origin may exist.
+ command addPrivacySandboxCoordinatorKeyConfig
+ parameters
+ PrivacySandboxAPI api
+ string coordinatorOrigin
+ string keyConfig
+ # BrowserContext to perform the action in. When omitted, default browser
+ # context is used.
+ optional BrowserContextID browserContextId
+
+
# This domain exposes CSS read/write operations. All CSS objects (stylesheets, rules, and styles)
# have an associated `id` used in subsequent operations on the related object. Each object type has
# a specific `id` structure, and those are not interchangeable between objects of different kinds.
@@ -2413,7 +2457,12 @@ experimental domain CSS
# For example, a value of '1em' is evaluated according to the computed
# 'font-size' of the element and a value 'calc(1px + 2px)' will be
# resolved to '3px'.
- command resolveValues
+ # If the `propertyName` was specified the `values` are resolved as if
+ # they were property's declaration. If a value cannot be parsed according
+ # to the provided property syntax, the value is parsed using combined
+ # syntax as if null `propertyName` was provided. If the value cannot be
+ # resolved even then, return the provided value without any changes.
+ experimental command resolveValues
parameters
# Substitution functions (var()/env()/attr()) and cascade-dependent
# keywords (revert/revert-layer) do not work.
@@ -2424,9 +2473,9 @@ experimental domain CSS
optional string propertyName
# Pseudo element type, only works for pseudo elements that generate
# elements in the tree, such as ::before and ::after.
- experimental optional DOM.PseudoType pseudoType
+ optional DOM.PseudoType pseudoType
# Pseudo element custom ident.
- experimental optional string pseudoIdentifier
+ optional string pseudoIdentifier
returns
array of string results
@@ -2963,6 +3012,7 @@ domain DOM
file-selector-button
details-content
picker
+ permission-icon
# Shadow root type.
type ShadowRootType extends string
@@ -3468,6 +3518,9 @@ domain DOM
PopoverTarget
# Get the interest target for a given element.
InterestTarget
+ # Get the commandfor target for a given element. In this case, this given
+ # element can only be an HTMLButtonElement.
+ CommandFor
returns
# NodeId of the element matching the queried relation.
NodeId nodeId
@@ -4346,6 +4399,25 @@ domain Emulation
depends on Page
depends on Runtime
+ experimental type SafeAreaInsets extends object
+ properties
+ # Overrides safe-area-inset-top.
+ optional integer top
+ # Overrides safe-area-max-inset-top.
+ optional integer topMax
+ # Overrides safe-area-inset-left.
+ optional integer left
+ # Overrides safe-area-max-inset-left.
+ optional integer leftMax
+ # Overrides safe-area-inset-bottom.
+ optional integer bottom
+ # Overrides safe-area-max-inset-bottom.
+ optional integer bottomMax
+ # Overrides safe-area-inset-right.
+ optional integer right
+ # Overrides safe-area-max-inset-right.
+ optional integer rightMax
+
# Screen orientation.
type ScreenOrientation extends object
properties
@@ -4516,6 +4588,12 @@ domain Emulation
# cleared.
optional DOM.RGBA color
+ # Overrides the values for env(safe-area-inset-*) and env(safe-area-max-inset-*). Unset values will cause the
+ # respective variables to be undefined, even if previously overridden.
+ experimental command setSafeAreaInsetsOverride
+ parameters
+ SafeAreaInsets insets
+
# Overrides the values of device screen dimensions (window.screen.width, window.screen.height,
# window.innerWidth, window.innerHeight, and "device-width"/"device-height"-related CSS media
# query results).
@@ -4549,7 +4627,8 @@ domain Emulation
experimental optional Page.Viewport viewport
# If set, the display feature of a multi-segment screen. If not set, multi-segment support
# is turned-off.
- experimental optional DisplayFeature displayFeature
+ # Deprecated, use Emulation.setDisplayFeaturesOverride.
+ experimental deprecated optional DisplayFeature displayFeature
# If set, the posture of a foldable device. If not set the posture is set
# to continuous.
# Deprecated, use Emulation.setDevicePostureOverride.
@@ -4567,6 +4646,18 @@ domain Emulation
# Does nothing if no override is set.
experimental command clearDevicePostureOverride
+ # Start using the given display features to pupulate the Viewport Segments API.
+ # This override can also be set in setDeviceMetricsOverride().
+ experimental command setDisplayFeaturesOverride
+ parameters
+ array of DisplayFeature features
+
+ # Clears the display features override set with either setDeviceMetricsOverride()
+ # or setDisplayFeaturesOverride() and starts using display features from the
+ # platform again.
+ # Does nothing if no override is set.
+ experimental command clearDisplayFeaturesOverride
+
experimental command setScrollbarsHidden
parameters
# Whether scrollbars should be always hidden.
@@ -4608,8 +4699,8 @@ domain Emulation
protanopia
tritanopia
- # Overrides the Geolocation Position or Error. Omitting any of the parameters emulates position
- # unavailable.
+ # Overrides the Geolocation Position or Error. Omitting latitude, longitude or
+ # accuracy emulates position unavailable.
command setGeolocationOverride
parameters
# Mock latitude
@@ -4618,6 +4709,14 @@ domain Emulation
optional number longitude
# Mock accuracy
optional number accuracy
+ # Mock altitude
+ optional number altitude
+ # Mock altitudeAccuracy
+ optional number altitudeAccuracy
+ # Mock heading
+ optional number heading
+ # Mock speed
+ optional number speed
experimental command getOverriddenSensorInformation
parameters
@@ -4653,6 +4752,7 @@ domain Emulation
PressureSource source
optional PressureMetadata metadata
+ # TODO: OBSOLETE: To remove when setPressureDataOverride is merged.
# Provides a given pressure state that will be processed and eventually be
# delivered to PressureObserver users. |source| must have been previously
# overridden by setPressureSourceOverrideEnabled.
@@ -4661,6 +4761,15 @@ domain Emulation
PressureSource source
PressureState state
+ # Provides a given pressure data set that will be processed and eventually be
+ # delivered to PressureObserver users. |source| must have been previously
+ # overridden by setPressureSourceOverrideEnabled.
+ experimental command setPressureDataOverride
+ parameters
+ PressureSource source
+ PressureState state
+ optional number ownContributionEstimate
+
# Overrides the Idle state.
command setIdleOverride
parameters
@@ -4778,6 +4887,14 @@ domain Emulation
# Whether the override should be enabled.
boolean enabled
+ # Allows overriding the difference between the small and large viewport sizes, which determine the
+ # value of the `svh` and `lvh` unit, respectively. Only supported for top-level frames.
+ experimental command setSmallViewportHeightDifferenceOverride
+ parameters
+ # This will cause an element of size 100svh to be `difference` pixels smaller than an element
+ # of size 100lvh.
+ integer difference
+
# This domain provides experimental commands only supported in headless mode.
experimental domain HeadlessExperimental
depends on Page
@@ -5872,6 +5989,7 @@ domain Network
Ping
CSPViolationReport
Preflight
+ FedCM
Other
# Unique loader identifier.
@@ -6124,6 +6242,7 @@ domain Network
mixed-content
origin
inspector
+ integrity
subresource-filter
content-type
coep-frame-resource-needs-coep-header
@@ -6266,6 +6385,7 @@ domain Network
cache
fetch-event
race-network-and-fetch-handler
+ race-network-and-cache
experimental type ServiceWorkerRouterInfo extends object
properties
@@ -6581,6 +6701,8 @@ domain Network
PortMismatch
# The cookie's source scheme value does not match the request origin's scheme.
SchemeMismatch
+ # Unpartitioned cookie access from an anonymous context was blocked.
+ AnonymousContext
# Types of reasons why a cookie should have been blocked by 3PCD but is exempted for the request.
experimental type CookieExemptionReason extends string
@@ -6916,6 +7038,8 @@ domain Network
experimental optional integer maxResourceBufferSize
# Longest post body size (in bytes) that would be included in requestWillBeSent notification
optional integer maxPostDataSize
+ # Whether DirectSocket chunk send/receive events should be reported.
+ experimental optional boolean reportDirectSocketTraffic
# Returns all browser cookies. Depending on the backend support, will return detailed cookie
# information in the `cookies` field.
@@ -7379,6 +7503,148 @@ domain Network
# Timestamp.
MonotonicTime timestamp
+ experimental type DirectSocketDnsQueryType extends string
+ enum
+ ipv4
+ ipv6
+
+ experimental type DirectTCPSocketOptions extends object
+ properties
+ # TCP_NODELAY option
+ boolean noDelay
+ # Expected to be unsigned integer.
+ optional number keepAliveDelay
+ # Expected to be unsigned integer.
+ optional number sendBufferSize
+ # Expected to be unsigned integer.
+ optional number receiveBufferSize
+ optional DirectSocketDnsQueryType dnsQueryType
+
+
+ # Fired upon direct_socket.TCPSocket creation.
+ experimental event directTCPSocketCreated
+ parameters
+ RequestId identifier
+ string remoteAddr
+ # Unsigned int 16.
+ integer remotePort
+ DirectTCPSocketOptions options
+ MonotonicTime timestamp
+ optional Initiator initiator
+
+ # Fired when direct_socket.TCPSocket connection is opened.
+ experimental event directTCPSocketOpened
+ parameters
+ RequestId identifier
+ string remoteAddr
+ # Expected to be unsigned integer.
+ integer remotePort
+ MonotonicTime timestamp
+ optional string localAddr
+ # Expected to be unsigned integer.
+ optional integer localPort
+
+ # Fired when direct_socket.TCPSocket is aborted.
+ experimental event directTCPSocketAborted
+ parameters
+ RequestId identifier
+ string errorMessage
+ MonotonicTime timestamp
+
+ # Fired when direct_socket.TCPSocket is closed.
+ experimental event directTCPSocketClosed
+ parameters
+ RequestId identifier
+ MonotonicTime timestamp
+
+ # Fired when data is sent to tcp direct socket stream.
+ experimental event directTCPSocketChunkSent
+ parameters
+ RequestId identifier
+ binary data
+ MonotonicTime timestamp
+
+ # Fired when data is received from tcp direct socket stream.
+ experimental event directTCPSocketChunkReceived
+ parameters
+ RequestId identifier
+ binary data
+ MonotonicTime timestamp
+
+ experimental type DirectUDPSocketOptions extends object
+ properties
+ optional string remoteAddr
+ # Unsigned int 16.
+ optional integer remotePort
+
+ optional string localAddr
+ # Unsigned int 16.
+ optional integer localPort
+
+ optional DirectSocketDnsQueryType dnsQueryType
+
+ # Expected to be unsigned integer.
+ optional number sendBufferSize
+ # Expected to be unsigned integer.
+ optional number receiveBufferSize
+
+
+ # Fired upon direct_socket.UDPSocket creation.
+ experimental event directUDPSocketCreated
+ parameters
+ RequestId identifier
+ DirectUDPSocketOptions options
+ MonotonicTime timestamp
+ optional Initiator initiator
+
+ # Fired when direct_socket.UDPSocket connection is opened.
+ experimental event directUDPSocketOpened
+ parameters
+ RequestId identifier
+ string localAddr
+ # Expected to be unsigned integer.
+ integer localPort
+ MonotonicTime timestamp
+ optional string remoteAddr
+ # Expected to be unsigned integer.
+ optional integer remotePort
+
+ # Fired when direct_socket.UDPSocket is aborted.
+ experimental event directUDPSocketAborted
+ parameters
+ RequestId identifier
+ string errorMessage
+ MonotonicTime timestamp
+
+ # Fired when direct_socket.UDPSocket is closed.
+ experimental event directUDPSocketClosed
+ parameters
+ RequestId identifier
+ MonotonicTime timestamp
+
+ experimental type DirectUDPMessage extends object
+ properties
+ binary data
+ # Null for connected mode.
+ optional string remoteAddr
+ # Null for connected mode.
+ # Expected to be unsigned integer.
+ optional integer remotePort
+
+ # Fired when message is sent to udp direct socket stream.
+ experimental event directUDPSocketChunkSent
+ parameters
+ RequestId identifier
+ DirectUDPMessage message
+ MonotonicTime timestamp
+
+ # Fired when message is received from udp direct socket stream.
+ experimental event directUDPSocketChunkReceived
+ parameters
+ RequestId identifier
+ DirectUDPMessage message
+ MonotonicTime timestamp
+
experimental type PrivateNetworkRequestPolicy extends string
enum
Allow
@@ -7387,6 +7653,7 @@ domain Network
PreflightBlock
PreflightWarn
PermissionBlock
+ PermissionWarn
experimental type IPAddressSpace extends string
enum
@@ -7711,7 +7978,7 @@ domain Network
LoadNetworkResourcePageResult resource
# Sets Controls for third-party cookie access
- # Page reload is required before the new cookie bahavior will be observed
+ # Page reload is required before the new cookie behavior will be observed
experimental command setCookieControls
parameters
# Whether 3pc restriction is enabled.
@@ -8287,6 +8554,7 @@ domain Page
# All Permissions Policy features. This enum should match the one defined
# in services/network/public/cpp/permissions_policy/permissions_policy_features.json5.
+ # LINT.IfChange(PermissionsPolicyFeature)
experimental type PermissionsPolicyFeature extends string
enum
accelerometer
@@ -8329,6 +8597,7 @@ domain Page
cross-origin-isolated
deferred-fetch
deferred-fetch-minimal
+ device-attributes
digital-credentials-get
direct-sockets
direct-sockets-private
@@ -8350,11 +8619,14 @@ domain Page
interest-cohort
join-ad-interest-group
keyboard-map
+ language-detector
local-fonts
+ local-network-access
magnetometer
media-playback-while-not-visible
microphone
midi
+ on-device-speech-recognition
otp-credentials
payment
picture-in-picture
@@ -8364,6 +8636,8 @@ domain Page
private-state-token-redemption
publickey-credentials-create
publickey-credentials-get
+ record-ad-auction-events
+ rewriter
run-ad-auction
screen-wake-lock
serial
@@ -8374,7 +8648,9 @@ domain Page
speaker-selection
storage-access
sub-apps
+ summarizer
sync-xhr
+ translator
unload
usb
usb-unrestricted
@@ -8383,7 +8659,9 @@ domain Page
web-printing
web-share
window-management
+ writer
xr-spatial-tracking
+ # LINT.ThenChange(//services/network/public/cpp/permissions_policy/permissions_policy_features.json5:PermissionsPolicy)
# Reason for a permissions policy feature to be disabled.
experimental type PermissionsPolicyBlockReason extends string
@@ -9012,13 +9290,15 @@ domain Page
# Recommendation for manifest's id attribute to match current id computed from start_url
optional string recommendedId
- experimental command getAdScriptId
+ experimental command getAdScriptAncestryIds
parameters
FrameId frameId
returns
- # Identifies the bottom-most script which caused the frame to be labelled
- # as an ad. Only sent if frame is labelled as an ad and id is available.
- optional AdScriptId adScriptId
+ # The ancestry chain of ad script identifiers leading to this frame's
+ # creation, ordered from the most immediate script (in the frame creation
+ # stack) to more distant ancestors (that created the immediately preceding
+ # script). Only sent if frame is labelled as an ad and ids are available.
+ array of AdScriptId adScriptAncestryIds
# Returns present frame tree structure.
command getFrameTree
@@ -9419,7 +9699,7 @@ domain Page
autoReject
autoOptOut
-# Sets the Secure Payment Confirmation transaction mode.
+ # Sets the Secure Payment Confirmation transaction mode.
# https://w3c.github.io/secure-payment-confirmation/#sctn-automation-set-spc-transaction-mode
experimental command setSPCTransactionMode
parameters
@@ -9448,6 +9728,10 @@ domain Page
command setInterceptFileChooserDialog
parameters
boolean enabled
+ # If true, cancels the dialog by emitting relevant events (if any)
+ # in addition to not showing it if the interception is enabled
+ # (default: false).
+ experimental optional boolean cancel
event domContentEventFired
parameters
@@ -9626,6 +9910,8 @@ domain Page
# closed.
event javascriptDialogClosed
parameters
+ # Frame id.
+ experimental FrameId frameId
# Whether dialog was confirmed.
boolean result
# User input in case of prompt.
@@ -9637,6 +9923,8 @@ domain Page
parameters
# Frame url.
string url
+ # Frame id.
+ experimental FrameId frameId
# Message that will be displayed by the dialog.
string message
# Dialog type.
@@ -9807,6 +10095,8 @@ domain Page
RequestedByWebViewClient
PostMessageByWebViewClient
CacheControlNoStoreDeviceBoundSessionTerminated
+ CacheLimitPrunedOnModerateMemoryPressure
+ CacheLimitPrunedOnCriticalMemoryPressure
# Types of not restored reasons for back-forward cache.
experimental type BackForwardCacheNotRestoredReasonType extends string
@@ -10430,30 +10720,32 @@ experimental domain Storage
bidderTrustedSignals
sellerTrustedSignals
- # Enum of shared storage access types.
- type SharedStorageAccessType extends string
- enum
- documentAddModule
- documentSelectURL
- documentRun
- documentSet
- documentAppend
- documentDelete
- documentClear
- documentGet
- workletSet
- workletAppend
- workletDelete
- workletClear
- workletGet
- workletKeys
- workletEntries
- workletLength
- workletRemainingBudget
- headerSet
- headerAppend
- headerDelete
- headerClear
+ # Enum of shared storage access scopes.
+ type SharedStorageAccessScope extends string
+ enum
+ window
+ sharedStorageWorklet
+ protectedAudienceWorklet
+ header
+
+ # Enum of shared storage access methods.
+ type SharedStorageAccessMethod extends string
+ enum
+ addModule
+ createWorklet
+ selectURL
+ run
+ batchUpdate
+ set
+ append
+ delete
+ clear
+ get
+ keys
+ values
+ entries
+ length
+ remainingBudget
# Struct for a single key-value pair in an origin's shared storage.
type SharedStorageEntry extends object
@@ -10474,6 +10766,19 @@ experimental domain Storage
# storage.
integer bytesUsed
+ # Represents a dictionary object passed in as privateAggregationConfig to
+ # run or selectURL.
+ type SharedStoragePrivateAggregationConfig extends object
+ properties
+ # The chosen aggregation service deployment.
+ optional string aggregationCoordinatorOrigin
+ # The context ID provided.
+ optional string contextId
+ # Configures the maximum size allowed for filtering IDs.
+ integer filteringIdMaxBytes
+ # The limit on the number of contributions in the final report.
+ optional integer maxContributions
+
# Pair of reporting metadata details for a candidate URL for `selectURL()`.
type SharedStorageReportingMetadata extends object
properties
@@ -10493,44 +10798,74 @@ experimental domain Storage
type SharedStorageAccessParams extends object
properties
# Spec of the module script URL.
- # Present only for SharedStorageAccessType.documentAddModule.
+ # Present only for SharedStorageAccessMethods: addModule and
+ # createWorklet.
optional string scriptSourceUrl
+ # String denoting "context-origin", "script-origin", or a custom
+ # origin to be used as the worklet's data origin.
+ # Present only for SharedStorageAccessMethod: createWorklet.
+ optional string dataOrigin
# Name of the registered operation to be run.
- # Present only for SharedStorageAccessType.documentRun and
- # SharedStorageAccessType.documentSelectURL.
+ # Present only for SharedStorageAccessMethods: run and selectURL.
optional string operationName
+ # ID of the operation call.
+ # Present only for SharedStorageAccessMethods: run and selectURL.
+ optional string operationId
+ # Whether or not to keep the worket alive for future run or selectURL
+ # calls.
+ # Present only for SharedStorageAccessMethods: run and selectURL.
+ optional boolean keepAlive
+ # Configures the private aggregation options.
+ # Present only for SharedStorageAccessMethods: run and selectURL.
+ optional SharedStoragePrivateAggregationConfig privateAggregationConfig
# The operation's serialized data in bytes (converted to a string).
- # Present only for SharedStorageAccessType.documentRun and
- # SharedStorageAccessType.documentSelectURL.
+ # Present only for SharedStorageAccessMethods: run and selectURL.
+ # TODO(crbug.com/401011862): Consider updating this parameter to binary.
optional string serializedData
# Array of candidate URLs' specs, along with any associated metadata.
- # Present only for SharedStorageAccessType.documentSelectURL.
+ # Present only for SharedStorageAccessMethod: selectURL.
optional array of SharedStorageUrlWithMetadata urlsWithMetadata
+ # Spec of the URN:UUID generated for a selectURL call.
+ # Present only for SharedStorageAccessMethod: selectURL.
+ optional string urnUuid
# Key for a specific entry in an origin's shared storage.
- # Present only for SharedStorageAccessType.documentSet,
- # SharedStorageAccessType.documentAppend,
- # SharedStorageAccessType.documentDelete,
- # SharedStorageAccessType.workletSet,
- # SharedStorageAccessType.workletAppend,
- # SharedStorageAccessType.workletDelete,
- # SharedStorageAccessType.workletGet,
- # SharedStorageAccessType.headerSet,
- # SharedStorageAccessType.headerAppend, and
- # SharedStorageAccessType.headerDelete.
+ # Present only for SharedStorageAccessMethods: set, append, delete, and
+ # get.
optional string key
# Value for a specific entry in an origin's shared storage.
- # Present only for SharedStorageAccessType.documentSet,
- # SharedStorageAccessType.documentAppend,
- # SharedStorageAccessType.workletSet,
- # SharedStorageAccessType.workletAppend,
- # SharedStorageAccessType.headerSet, and
- # SharedStorageAccessType.headerAppend.
+ # Present only for SharedStorageAccessMethods: set and append.
optional string value
# Whether or not to set an entry for a key if that key is already present.
- # Present only for SharedStorageAccessType.documentSet,
- # SharedStorageAccessType.workletSet, and
- # SharedStorageAccessType.headerSet.
+ # Present only for SharedStorageAccessMethod: set.
optional boolean ignoreIfPresent
+ # If the method is called on a shared storage worklet, or as part of
+ # a shared storage worklet script, it will have a number for the
+ # associated worklet, denoting the (0-indexed) order of the worklet's
+ # creation relative to all other shared storage worklets created by
+ # documents using the current storage partition.
+ # Present only for SharedStorageAccessMethods: addModule, createWorklet,
+ # run, selectURL, and any other SharedStorageAccessMethod when the
+ # SharedStorageAccessScope is sharedStorageWorklet.
+ # TODO(crbug.com/401011862): Pass this only for addModule & createWorklet.
+ optional integer workletOrdinal
+ # Hex representation of the DevTools token used as the TargetID for the
+ # associated shared storage worklet.
+ # Present only for SharedStorageAccessMethods: addModule, createWorklet,
+ # run, selectURL, and any other SharedStorageAccessMethod when the
+ # SharedStorageAccessScope is sharedStorageWorklet.
+ optional Target.TargetID workletTargetId
+ # Name of the lock to be acquired, if present.
+ # Optionally present only for SharedStorageAccessMethods: batchUpdate,
+ # set, append, delete, and clear.
+ optional string withLock
+ # If the method has been called as part of a batchUpdate, then this
+ # number identifies the batch to which it belongs.
+ # Optionally present only for SharedStorageAccessMethods:
+ # batchUpdate (required), set, append, delete, and clear.
+ optional string batchUpdateId
+ # Number of modifier methods sent in batch.
+ # Present only for SharedStorageAccessMethod: batchUpdate.
+ optional integer batchSize
type StorageBucketsDurability extends string
enum
@@ -10869,16 +11204,41 @@ experimental domain Storage
parameters
# Time of the access.
Network.TimeSinceEpoch accessTime
+ # Enum value indicating the access scope.
+ SharedStorageAccessScope scope
# Enum value indicating the Shared Storage API method invoked.
- SharedStorageAccessType type
+ SharedStorageAccessMethod method
# DevTools Frame Token for the primary frame tree's root.
Page.FrameId mainFrameId
- # Serialized origin for the context that invoked the Shared Storage API.
+ # Serialization of the origin owning the Shared Storage data.
string ownerOrigin
+ # Serialization of the site owning the Shared Storage data.
+ string ownerSite
# The sub-parameters wrapped by `params` are all optional and their
# presence/absence depends on `type`.
SharedStorageAccessParams params
+ # A shared storage run or selectURL operation finished its execution.
+ # The following parameters are included in all events.
+ event sharedStorageWorkletOperationExecutionFinished
+ parameters
+ # Time that the operation finished.
+ Network.TimeSinceEpoch finishedTime
+ # Time, in microseconds, from start of shared storage JS API call until
+ # end of operation execution in the worklet.
+ integer executionTime
+ # Enum value indicating the Shared Storage API method invoked.
+ SharedStorageAccessMethod method
+ # ID of the operation call.
+ string operationId
+ # Hex representation of the DevTools token used as the TargetID for the
+ # associated shared storage worklet.
+ Target.TargetID workletTargetId
+ # DevTools Frame Token for the primary frame tree's root.
+ Page.FrameId mainFrameId
+ # Serialization of the origin owning the Shared Storage data.
+ string ownerOrigin
+
event storageBucketCreatedOrUpdated
parameters
StorageBucketInfo bucketInfo
@@ -10942,13 +11302,6 @@ experimental domain Storage
# duration in seconds
array of integer ends
- experimental type AttributionReportingTriggerSpec extends object
- properties
- # number instead of integer because not all uint32 can be represented by
- # int
- array of number triggerData
- AttributionReportingEventReportWindows eventReportWindows
-
experimental type AttributionReportingTriggerDataMatching extends string
enum
exact
@@ -10979,12 +11332,20 @@ experimental domain Storage
number limit
number maxEventStates
+ experimental type AttributionReportingNamedBudgetDef extends object
+ properties
+ string name
+ integer budget
+
experimental type AttributionReportingSourceRegistration extends object
properties
Network.TimeSinceEpoch time
# duration in seconds
integer expiry
- array of AttributionReportingTriggerSpec triggerSpecs
+ # number instead of integer because not all uint32 can be represented by
+ # int
+ array of number triggerData
+ AttributionReportingEventReportWindows eventReportWindows
# duration in seconds
integer aggregatableReportWindow
AttributionReportingSourceType type
@@ -11001,6 +11362,9 @@ experimental domain Storage
AttributionReportingAggregatableDebugReportingConfig aggregatableDebugReportingConfig
optional AttributionScopesData scopesData
integer maxEventLevelReports
+ array of AttributionReportingNamedBudgetDef namedBudgets
+ boolean debugReporting
+ number eventLevelEpsilon
experimental type AttributionReportingSourceRegistrationResult extends string
enum
@@ -11063,6 +11427,11 @@ experimental domain Storage
optional UnsignedInt64AsBase10 dedupKey
AttributionReportingFilterPair filters
+ experimental type AttributionReportingNamedBudgetCandidate extends object
+ properties
+ optional string name
+ AttributionReportingFilterPair filters
+
experimental type AttributionReportingTriggerRegistration extends object
properties
AttributionReportingFilterPair filters
@@ -11078,6 +11447,7 @@ experimental domain Storage
optional string triggerContextId
AttributionReportingAggregatableDebugReportingConfig aggregatableDebugReportingConfig
array of string scopes
+ array of AttributionReportingNamedBudgetCandidate namedBudgets
experimental type AttributionReportingEventLevelResult extends string
enum
@@ -11125,6 +11495,28 @@ experimental domain Storage
AttributionReportingEventLevelResult eventLevel
AttributionReportingAggregatableResult aggregatable
+ experimental type AttributionReportingReportResult extends string
+ enum
+ # A network request was attempted for the report.
+ sent
+ # No request was attempted because of browser policy.
+ prohibited
+ # No request was attempted because of an error in report assembly,
+ # e.g. the aggregation service was unavailable.
+ failedToAssemble
+ # No request was attempted because the report's expiry passed.
+ expired
+
+ experimental event attributionReportingReportSent
+ parameters
+ string url
+ object body
+ AttributionReportingReportResult result
+ # If result is `sent`, populated with net/HTTP status.
+ optional integer netError
+ optional string netErrorName
+ optional integer httpStatusCode
+
# A single Related Website Set object.
experimental type RelatedWebsiteSet extends object
properties
@@ -11156,6 +11548,12 @@ experimental domain Storage
# party URL, only the first-party URL is returned in the array.
array of string matchedUrls
+ command setProtectedAudienceKAnonymity
+ parameters
+ string owner
+ string name
+ array of binary hashes
+
# The SystemInfo domain defines methods and events for querying low-level system information.
experimental domain SystemInfo
@@ -11451,6 +11849,10 @@ domain Target
optional boolean background
# Whether to create the target of type "tab".
experimental optional boolean forTab
+ # Whether to create a hidden target. The hidden target is observable via protocol, but not
+ # present in the tab UI strip. Cannot be created with `forTab: true`, `newWindow: true` or
+ # `background: false`. The life-time of the tab is limited to the life-time of the session.
+ experimental optional boolean hidden
returns
# The id of the page opened.
TargetID targetId
@@ -11498,11 +11900,14 @@ domain Target
# Deprecated.
deprecated optional TargetID targetId
- # Controls whether to automatically attach to new targets which are considered to be related to
- # this one. When turned on, attaches to all existing related targets as well. When turned off,
+ # Controls whether to automatically attach to new targets which are considered
+ # to be directly related to this one (for example, iframes or workers).
+ # When turned on, attaches to all existing related targets as well. When turned off,
# automatically detaches from all currently attached targets.
# This also clears all targets added by `autoAttachRelated` from the list of targets to watch
# for creation of related targets.
+ # You might want to call this recursively for auto-attached targets to attach
+ # to all available targets.
command setAutoAttach
parameters
# Whether to auto-attach to related targets.
@@ -12697,7 +13102,6 @@ experimental domain Preload
InvalidSchemeRedirect
InvalidSchemeNavigation
NavigationRequestBlockedByCsp
- MainFrameNavigation
MojoBinderPolicy
RendererProcessCrashed
RendererProcessKilled
@@ -12798,6 +13202,7 @@ experimental domain Preload
PrefetchFailedMIMENotSupported
PrefetchFailedNetError
PrefetchFailedNon2XX
+ PrefetchEvictedAfterBrowsingDataRemoved
PrefetchEvictedAfterCandidateRemoved
PrefetchEvictedForNewerPrefetch
PrefetchHeldback
@@ -12815,6 +13220,9 @@ experimental domain Preload
PrefetchNotEligibleSchemeIsNotHttps
PrefetchNotEligibleUserHasCookies
PrefetchNotEligibleUserHasServiceWorker
+ PrefetchNotEligibleUserHasServiceWorkerNoFetchHandler
+ PrefetchNotEligibleRedirectFromServiceWorker
+ PrefetchNotEligibleRedirectToServiceWorker
PrefetchNotEligibleBatterySaverEnabled
PrefetchNotEligiblePreloadingDisabled
PrefetchNotFinishedInTime
@@ -13092,6 +13500,33 @@ experimental domain BluetoothEmulation
powered-off
powered-on
+ # Indicates the various types of GATT event.
+ type GATTOperationType extends string
+ enum
+ connection
+ discovery
+
+ # Indicates the various types of characteristic write.
+ type CharacteristicWriteType extends string
+ enum
+ write-default-deprecated
+ write-with-response
+ write-without-response
+
+ # Indicates the various types of characteristic operation.
+ type CharacteristicOperationType extends string
+ enum
+ read
+ write
+ subscribe-to-notifications
+ unsubscribe-from-notifications
+
+ # Indicates the various types of descriptor operation.
+ type DescriptorOperationType extends string
+ enum
+ read
+ write
+
# Stores the manufacturer data
type ManufacturerData extends object
properties
@@ -13122,8 +13557,29 @@ experimental domain BluetoothEmulation
integer rssi
ScanRecord scanRecord
+ # Describes the properties of a characteristic. This follows Bluetooth Core
+ # Specification BT 4.2 Vol 3 Part G 3.3.1. Characteristic Properties.
+ type CharacteristicProperties extends object
+ properties
+ optional boolean broadcast
+ optional boolean read
+ optional boolean writeWithoutResponse
+ optional boolean write
+ optional boolean notify
+ optional boolean indicate
+ optional boolean authenticatedSignedWrites
+ optional boolean extendedProperties
+
# Enable the BluetoothEmulation domain.
command enable
+ parameters
+ # State of the simulated central.
+ CentralState state
+ # If the simulated central supports low-energy.
+ boolean leSupported
+
+ # Set the state of the simulated central.
+ command setSimulatedCentralState
parameters
# State of the simulated central.
CentralState state
@@ -13145,3 +13601,113 @@ experimental domain BluetoothEmulation
command simulateAdvertisement
parameters
ScanEntry entry
+
+ # Simulates the response code from the peripheral with |address| for a
+ # GATT operation of |type|. The |code| value follows the HCI Error Codes from
+ # Bluetooth Core Specification Vol 2 Part D 1.3 List Of Error Codes.
+ command simulateGATTOperationResponse
+ parameters
+ string address
+ GATTOperationType type
+ integer code
+
+ # Simulates the response from the characteristic with |characteristicId| for a
+ # characteristic operation of |type|. The |code| value follows the Error
+ # Codes from Bluetooth Core Specification Vol 3 Part F 3.4.1.1 Error Response.
+ # The |data| is expected to exist when simulating a successful read operation
+ # response.
+ command simulateCharacteristicOperationResponse
+ parameters
+ string characteristicId
+ CharacteristicOperationType type
+ integer code
+ optional binary data
+
+ # Simulates the response from the descriptor with |descriptorId| for a
+ # descriptor operation of |type|. The |code| value follows the Error
+ # Codes from Bluetooth Core Specification Vol 3 Part F 3.4.1.1 Error Response.
+ # The |data| is expected to exist when simulating a successful read operation
+ # response.
+ command simulateDescriptorOperationResponse
+ parameters
+ string descriptorId
+ DescriptorOperationType type
+ integer code
+ optional binary data
+
+ # Adds a service with |serviceUuid| to the peripheral with |address|.
+ command addService
+ parameters
+ string address
+ string serviceUuid
+ returns
+ # An identifier that uniquely represents this service.
+ string serviceId
+
+ # Removes the service respresented by |serviceId| from the simulated central.
+ command removeService
+ parameters
+ string serviceId
+
+ # Adds a characteristic with |characteristicUuid| and |properties| to the
+ # service represented by |serviceId|.
+ command addCharacteristic
+ parameters
+ string serviceId
+ string characteristicUuid
+ CharacteristicProperties properties
+ returns
+ # An identifier that uniquely represents this characteristic.
+ string characteristicId
+
+ # Removes the characteristic respresented by |characteristicId| from the
+ # simulated central.
+ command removeCharacteristic
+ parameters
+ string characteristicId
+
+ # Adds a descriptor with |descriptorUuid| to the characteristic respresented
+ # by |characteristicId|.
+ command addDescriptor
+ parameters
+ string characteristicId
+ string descriptorUuid
+ returns
+ # An identifier that uniquely represents this descriptor.
+ string descriptorId
+
+ # Removes the descriptor with |descriptorId| from the simulated central.
+ command removeDescriptor
+ parameters
+ string descriptorId
+
+ # Simulates a GATT disconnection from the peripheral with |address|.
+ command simulateGATTDisconnection
+ parameters
+ string address
+
+ # Event for when a GATT operation of |type| to the peripheral with |address|
+ # happened.
+ event gattOperationReceived
+ parameters
+ string address
+ GATTOperationType type
+
+ # Event for when a characteristic operation of |type| to the characteristic
+ # respresented by |characteristicId| happened. |data| and |writeType| is
+ # expected to exist when |type| is write.
+ event characteristicOperationReceived
+ parameters
+ string characteristicId
+ CharacteristicOperationType type
+ optional binary data
+ optional CharacteristicWriteType writeType
+
+ # Event for when a descriptor operation of |type| to the descriptor
+ # respresented by |descriptorId| happened. |data| is expected to exist when
+ # |type| is write.
+ event descriptorOperationReceived
+ parameters
+ string descriptorId
+ DescriptorOperationType type
+ optional binary data
diff --git a/common/devtools/chromium/v135/js_protocol.pdl b/common/devtools/chromium/v138/js_protocol.pdl
similarity index 99%
rename from common/devtools/chromium/v135/js_protocol.pdl
rename to common/devtools/chromium/v138/js_protocol.pdl
index e33cdae701a12..73da9149b5d8b 100644
--- a/common/devtools/chromium/v135/js_protocol.pdl
+++ b/common/devtools/chromium/v138/js_protocol.pdl
@@ -649,7 +649,7 @@ domain Debugger
Runtime.ExecutionContextId executionContextId
# Content hash of the script, SHA-256.
string hash
- # For Wasm modules, the content of the `build_id` custom section.
+ # For Wasm modules, the content of the `build_id` custom section. For JavaScript the `debugId` magic comment.
string buildId
# Embedder-specific auxiliary data likely matching {isDefault: boolean, type: 'default'|'isolated'|'worker', frameId: string}
optional object executionContextAuxData
@@ -690,7 +690,7 @@ domain Debugger
Runtime.ExecutionContextId executionContextId
# Content hash of the script, SHA-256.
string hash
- # For Wasm modules, the content of the `build_id` custom section.
+ # For Wasm modules, the content of the `build_id` custom section. For JavaScript the `debugId` magic comment.
string buildId
# Embedder-specific auxiliary data likely matching {isDefault: boolean, type: 'default'|'isolated'|'worker', frameId: string}
optional object executionContextAuxData
diff --git a/common/mirror/selenium b/common/mirror/selenium
index a5009018795d8..5a0fe85b9e918 100644
--- a/common/mirror/selenium
+++ b/common/mirror/selenium
@@ -3,13 +3,33 @@
"tag_name": "nightly",
"assets": [
{
- "browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/nightly/selenium-java-4.33.0-SNAPSHOT.zip"
+ "browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/nightly/selenium-java-4.34.0-SNAPSHOT.zip"
},
{
- "browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/nightly/selenium-server-4.33.0-SNAPSHOT.jar"
+ "browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/nightly/selenium-server-4.34.0-SNAPSHOT.jar"
},
{
- "browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/nightly/selenium-server-4.33.0-SNAPSHOT.zip"
+ "browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/nightly/selenium-server-4.34.0-SNAPSHOT.zip"
+ }
+ ]
+ },
+ {
+ "tag_name": "selenium-4.33.0",
+ "assets": [
+ {
+ "browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.33.0/selenium-dotnet-4.33.0.zip"
+ },
+ {
+ "browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.33.0/selenium-dotnet-strongnamed-4.33.0.zip"
+ },
+ {
+ "browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.33.0/selenium-java-4.33.0.zip"
+ },
+ {
+ "browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.33.0/selenium-server-4.33.0.jar"
+ },
+ {
+ "browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.33.0/selenium-server-4.33.0.zip"
}
]
},
@@ -836,25 +856,5 @@
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.5.0/selenium-server-4.5.3.zip"
}
]
- },
- {
- "tag_name": "selenium-4.4.0",
- "assets": [
- {
- "browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.4.0/selenium-dotnet-4.4.0.zip"
- },
- {
- "browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.4.0/selenium-dotnet-strongnamed-4.4.0.zip"
- },
- {
- "browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.4.0/selenium-java-4.4.0.zip"
- },
- {
- "browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.4.0/selenium-server-4.4.0.jar"
- },
- {
- "browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.4.0/selenium-server-4.4.0.zip"
- }
- ]
}
]
diff --git a/common/repositories.bzl b/common/repositories.bzl
index 094a5597d9ed0..a53fc1565a772 100644
--- a/common/repositories.bzl
+++ b/common/repositories.bzl
@@ -11,8 +11,8 @@ def pin_browsers():
http_archive(
name = "linux_firefox",
- url = "https://ftp.mozilla.org/pub/firefox/releases/138.0.4/linux-x86_64/en-US/firefox-138.0.4.tar.xz",
- sha256 = "c27d5bf7483eda49aae544d9f8b4f064dbc7341b27d7098378108e52071bf947",
+ url = "https://ftp.mozilla.org/pub/firefox/releases/140.0.2/linux-x86_64/en-US/firefox-140.0.2.tar.xz",
+ sha256 = "0de987e3065409d7feeba28e8b9c59c8270b917a293c140a5423579c7e70f8ce",
build_file_content = """
load("@aspect_rules_js//js:defs.bzl", "js_library")
package(default_visibility = ["//visibility:public"])
@@ -33,8 +33,8 @@ js_library(
dmg_archive(
name = "mac_firefox",
- url = "https://ftp.mozilla.org/pub/firefox/releases/138.0.4/mac/en-US/Firefox%20138.0.4.dmg",
- sha256 = "6842663f38b8b12b08b67239f0cc2118e93fa0b5b57e856c21f384fb501fb430",
+ url = "https://ftp.mozilla.org/pub/firefox/releases/140.0.2/mac/en-US/Firefox%20140.0.2.dmg",
+ sha256 = "4584538f48fc104a83cd5b62b72f027e70bffb8cb6ea56dd24e3657347cfa979",
build_file_content = """
load("@aspect_rules_js//js:defs.bzl", "js_library")
package(default_visibility = ["//visibility:public"])
@@ -50,8 +50,8 @@ js_library(
http_archive(
name = "linux_beta_firefox",
- url = "https://ftp.mozilla.org/pub/firefox/releases/139.0b10/linux-x86_64/en-US/firefox-139.0b10.tar.xz",
- sha256 = "c369df6474ffdece0eff47e8750d52ed7663bf1ecee88d9a19f70b3e2b206cf8",
+ url = "https://ftp.mozilla.org/pub/firefox/releases/141.0b3/linux-x86_64/en-US/firefox-141.0b3.tar.xz",
+ sha256 = "9f7cc8fc0ee1ae566a6ff54721428ef733d27baf8edae5bb7b8b9117616e48da",
build_file_content = """
load("@aspect_rules_js//js:defs.bzl", "js_library")
package(default_visibility = ["//visibility:public"])
@@ -72,8 +72,8 @@ js_library(
dmg_archive(
name = "mac_beta_firefox",
- url = "https://ftp.mozilla.org/pub/firefox/releases/139.0b10/mac/en-US/Firefox%20139.0b10.dmg",
- sha256 = "48bc5bf417013e457a6f3437271cbeee6bd67a0a8381bbd7deb198dc9caa3057",
+ url = "https://ftp.mozilla.org/pub/firefox/releases/141.0b3/mac/en-US/Firefox%20141.0b3.dmg",
+ sha256 = "47dc6a456bc80baa784381e94f4dc4f2f7ddfdf94b0af0bb20d9678f16d28898",
build_file_content = """
load("@aspect_rules_js//js:defs.bzl", "js_library")
package(default_visibility = ["//visibility:public"])
@@ -123,10 +123,10 @@ js_library(
pkg_archive(
name = "mac_edge",
- url = "https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/8b523c53-9ba6-4310-b0d3-9391eaf174f7/MicrosoftEdge-136.0.3240.76.pkg",
- sha256 = "6843377514a8ab215423998e039dcf95ec240300ed12e19f2244fd7bf77a68f1",
+ url = "https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/3c804dbf-368d-489d-8836-9756b2d4b017/MicrosoftEdge-138.0.3351.55.pkg",
+ sha256 = "1ff1aecb62fe10151a4ebfd05b9834a4d94955d7f58ba434b2576468381c0f9b",
move = {
- "MicrosoftEdge-136.0.3240.76.pkg/Payload/Microsoft Edge.app": "Edge.app",
+ "MicrosoftEdge-138.0.3351.55.pkg/Payload/Microsoft Edge.app": "Edge.app",
},
build_file_content = """
load("@aspect_rules_js//js:defs.bzl", "js_library")
@@ -143,8 +143,8 @@ js_library(
deb_archive(
name = "linux_edge",
- url = "https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_136.0.3240.76-1_amd64.deb",
- sha256 = "6e234cd5ec49ff151c9a16631fb65c145f5c615aac3dabdb6edb099d1565c85a",
+ url = "https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_138.0.3351.55-1_amd64.deb",
+ sha256 = "4990ad02387363c06ac0cf48312db4f35456c514fee20420ae3bdeedabccec1a",
build_file_content = """
load("@aspect_rules_js//js:defs.bzl", "js_library")
package(default_visibility = ["//visibility:public"])
@@ -165,8 +165,8 @@ js_library(
http_archive(
name = "linux_edgedriver",
- url = "https://msedgedriver.azureedge.net/136.0.3240.76/edgedriver_linux64.zip",
- sha256 = "dbab1e25a3dc1013a929be5626324ee3ac0575b747793da51d6b8de93f0f2ff2",
+ url = "https://msedgedriver.azureedge.net/138.0.3351.55/edgedriver_linux64.zip",
+ sha256 = "cfa15f718ea556a1bbc845fafe53909eaa2572058f8cb485a5c637df217e9b60",
build_file_content = """
load("@aspect_rules_js//js:defs.bzl", "js_library")
package(default_visibility = ["//visibility:public"])
@@ -182,8 +182,8 @@ js_library(
http_archive(
name = "mac_edgedriver",
- url = "https://msedgedriver.azureedge.net/136.0.3240.76/edgedriver_mac64.zip",
- sha256 = "d1cc5424b522227f0c0950ac501e52a55e0fb44ee2ebc8af3a83fc9222363e8f",
+ url = "https://msedgedriver.azureedge.net/138.0.3351.55/edgedriver_mac64.zip",
+ sha256 = "fd5f5d567e3cc9f3735f496dab08c5f51f555ebf7cc19f16e1a52ebad2082022",
build_file_content = """
load("@aspect_rules_js//js:defs.bzl", "js_library")
package(default_visibility = ["//visibility:public"])
@@ -199,8 +199,8 @@ js_library(
http_archive(
name = "linux_chrome",
- url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.40/linux64/chrome-linux64.zip",
- sha256 = "1a17f1d70a085188eb78365b90b435d83350fcec1040a9383eea80ed97963204",
+ url = "https://storage.googleapis.com/chrome-for-testing-public/138.0.7204.49/linux64/chrome-linux64.zip",
+ sha256 = "8751e9a4a0ca7c8127acb06c4fe0c438d091c0fb1c3712dcd4ea277773177304",
build_file_content = """
load("@aspect_rules_js//js:defs.bzl", "js_library")
package(default_visibility = ["//visibility:public"])
@@ -218,11 +218,10 @@ js_library(
)
""",
)
-
http_archive(
name = "mac_chrome",
- url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.40/mac-x64/chrome-mac-x64.zip",
- sha256 = "65fb0ae59177d2196eb62fdeb88c455f8965af2e0e9ee6640d66765c7df75450",
+ url = "https://storage.googleapis.com/chrome-for-testing-public/138.0.7204.49/mac-x64/chrome-mac-x64.zip",
+ sha256 = "98e4f2e97a31ca7104f72ca1fbe506b0070dd181f0bccc1b4af90ff950ceaa57",
strip_prefix = "chrome-mac-x64",
patch_cmds = [
"mv 'Google Chrome for Testing.app' Chrome.app",
@@ -240,11 +239,10 @@ js_library(
)
""",
)
-
http_archive(
name = "linux_chromedriver",
- url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.40/linux64/chromedriver-linux64.zip",
- sha256 = "09246c6eaa804a39b8c54467bf4d62233577f67a9df11a33d8b27dd1b30a168c",
+ url = "https://storage.googleapis.com/chrome-for-testing-public/138.0.7204.49/linux64/chromedriver-linux64.zip",
+ sha256 = "0ef562acf7a87733a77cf51f52e3841cf7fb63c17d618b6ccb45a9a53ca89017",
strip_prefix = "chromedriver-linux64",
build_file_content = """
load("@aspect_rules_js//js:defs.bzl", "js_library")
@@ -261,8 +259,86 @@ js_library(
http_archive(
name = "mac_chromedriver",
- url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.40/mac-x64/chromedriver-mac-x64.zip",
- sha256 = "c3c7cd781b217694ce35b9b7e2f3c3d214982a023a0c1a21dae4af320e409928",
+ url = "https://storage.googleapis.com/chrome-for-testing-public/138.0.7204.49/mac-x64/chromedriver-mac-x64.zip",
+ sha256 = "bff1fc6075912698a1699a8d0979da3fdc576775a3fe78e6ae68338459c8882f",
+ strip_prefix = "chromedriver-mac-x64",
+ build_file_content = """
+load("@aspect_rules_js//js:defs.bzl", "js_library")
+package(default_visibility = ["//visibility:public"])
+
+exports_files(["chromedriver"])
+
+js_library(
+ name = "chromedriver-js",
+ data = ["chromedriver"],
+)
+""",
+ )
+
+ http_archive(
+ name = "linux_beta_chrome",
+ url = "https://storage.googleapis.com/chrome-for-testing-public/139.0.7258.6/linux64/chrome-linux64.zip",
+ sha256 = "9e13f092899dacaaf24a9f75ef9152ca32eccc0a3e92c442b655ef1df49166db",
+ build_file_content = """
+load("@aspect_rules_js//js:defs.bzl", "js_library")
+package(default_visibility = ["//visibility:public"])
+
+filegroup(
+ name = "files",
+ srcs = glob(["**/*"]),
+)
+
+exports_files(["chrome-linux64/chrome"])
+
+js_library(
+ name = "chrome-js",
+ data = [":files"],
+)
+""",
+ )
+ http_archive(
+ name = "mac_beta_chrome",
+ url = "https://storage.googleapis.com/chrome-for-testing-public/139.0.7258.6/mac-x64/chrome-mac-x64.zip",
+ sha256 = "feae578043bfe8625304f7ff84776038ee7e02c11c7502a67f0f1b89503d31ee",
+ strip_prefix = "chrome-mac-x64",
+ patch_cmds = [
+ "mv 'Google Chrome for Testing.app' Chrome.app",
+ "mv 'Chrome.app/Contents/MacOS/Google Chrome for Testing' Chrome.app/Contents/MacOS/Chrome",
+ ],
+ build_file_content = """
+load("@aspect_rules_js//js:defs.bzl", "js_library")
+package(default_visibility = ["//visibility:public"])
+
+exports_files(["Chrome.app"])
+
+js_library(
+ name = "chrome-js",
+ data = glob(["Chrome.app/**/*"]),
+)
+""",
+ )
+ http_archive(
+ name = "linux_beta_chromedriver",
+ url = "https://storage.googleapis.com/chrome-for-testing-public/139.0.7258.6/linux64/chromedriver-linux64.zip",
+ sha256 = "05acfaa7e695b62e9b605646fc499bf1ab0abb11d410e250e06305a93eb69496",
+ strip_prefix = "chromedriver-linux64",
+ build_file_content = """
+load("@aspect_rules_js//js:defs.bzl", "js_library")
+package(default_visibility = ["//visibility:public"])
+
+exports_files(["chromedriver"])
+
+js_library(
+ name = "chromedriver-js",
+ data = ["chromedriver"],
+)
+""",
+ )
+
+ http_archive(
+ name = "mac_beta_chromedriver",
+ url = "https://storage.googleapis.com/chrome-for-testing-public/139.0.7258.6/mac-x64/chromedriver-mac-x64.zip",
+ sha256 = "8f6c3b5af19b9e37582f82159a43f0b2cfe6eaa91102ea5a712b047ab63b9008",
strip_prefix = "chromedriver-mac-x64",
build_file_content = """
load("@aspect_rules_js//js:defs.bzl", "js_library")
diff --git a/common/selenium_manager.bzl b/common/selenium_manager.bzl
index 4eafc857cda4b..249504cdd6435 100644
--- a/common/selenium_manager.bzl
+++ b/common/selenium_manager.bzl
@@ -6,22 +6,22 @@ def selenium_manager():
http_file(
name = "download_sm_linux",
executable = True,
- sha256 = "d0b9509e5485ced51e1af8c65f92028d80d150ef40177a5b25cc5a4bdff7eb8f",
- url = "https://github.com/SeleniumHQ/selenium_manager_artifacts/releases/download/selenium-manager-de70611/selenium-manager-linux",
+ sha256 = "50099355b0e74b8bb231a5b152fc3de498dcde1cdebcefb1e501713e9b124b9d",
+ url = "https://github.com/SeleniumHQ/selenium_manager_artifacts/releases/download/selenium-manager-0ab9b6d/selenium-manager-linux",
)
http_file(
name = "download_sm_macos",
executable = True,
- sha256 = "737b89d42f60d00f2917b9a93a9f90da483554a9856a990887167e43987ff3fd",
- url = "https://github.com/SeleniumHQ/selenium_manager_artifacts/releases/download/selenium-manager-de70611/selenium-manager-macos",
+ sha256 = "eb98ce344acfaee3a7d58038331a8b49985ac724d2a9ec02258008c076979846",
+ url = "https://github.com/SeleniumHQ/selenium_manager_artifacts/releases/download/selenium-manager-0ab9b6d/selenium-manager-macos",
)
http_file(
name = "download_sm_windows",
executable = True,
- sha256 = "a074d27eddab10c7cb602c9bcc5e8dbb42067f946f07f2253ee42f12564663bb",
- url = "https://github.com/SeleniumHQ/selenium_manager_artifacts/releases/download/selenium-manager-de70611/selenium-manager-windows.exe",
+ sha256 = "7090d5737aebabb9daad49022b070d3456b8e43ae7f3ac5bcb780af67c371b3f",
+ url = "https://github.com/SeleniumHQ/selenium_manager_artifacts/releases/download/selenium-manager-0ab9b6d/selenium-manager-windows.exe",
)
def _selenium_manager_artifacts_impl(_ctx):
diff --git a/dotnet/BUILD.bazel b/dotnet/BUILD.bazel
index 5315ea13867f8..44ded9c69201b 100644
--- a/dotnet/BUILD.bazel
+++ b/dotnet/BUILD.bazel
@@ -2,7 +2,7 @@ load("@rules_pkg//pkg:zip.bzl", "pkg_zip")
exports_files([
"AssemblyInfo.cs.template",
- "WebDriver.snk",
+ "Selenium.snk",
])
pkg_zip(
diff --git a/dotnet/CHANGELOG b/dotnet/CHANGELOG
index 0bc90addf6aa6..21b660ef73b2e 100644
--- a/dotnet/CHANGELOG
+++ b/dotnet/CHANGELOG
@@ -1,3 +1,18 @@
+v4.34.0
+======
+* Add CDP for Chrome 138 and remove 135
+* [bidi] Add AcceptInsecureCerts and Proxy options when create new user context (#15795)
+* [bidi] Actively use TryGetValue while processing incoming messages
+* [bidi] Declare allowed nullable objects in constructors type (#15809)
+* [bidi] Simplify modules namespace (breaking change) (#15820)
+* Remove unnecessary stylecop files (#15824)
+* Align CS projects name to understand the editing context (#15843)
+* [bidi] Implicit conversion screenshot to bytes
+* [bidi] Adjust proxy configuration for new sessions (#15914)
+* [bidi] Add OnHistoryUpdated event (#15916)
+* Mark FTP proxy support as deprecated (#15925)
+* [bidi] Protect DTO types from inheritance (#15919)
+
v4.33.0
======
* Add CDP for Chrome 137 and remove 134
diff --git a/dotnet/WebDriver.NET.sln b/dotnet/Selenium.sln
similarity index 69%
rename from dotnet/WebDriver.NET.sln
rename to dotnet/Selenium.sln
index 945f8ecb8b3b9..59907c6346ca5 100644
--- a/dotnet/WebDriver.NET.sln
+++ b/dotnet/Selenium.sln
@@ -3,25 +3,25 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2026
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebDriver", "src\webdriver\WebDriver.csproj", "{ACCB2D1E-E2C9-4AC1-8EE3-6BF1C30AD713}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Selenium.WebDriver", "src\webdriver\Selenium.WebDriver.csproj", "{ACCB2D1E-E2C9-4AC1-8EE3-6BF1C30AD713}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebDriver.Support", "src\support\WebDriver.Support.csproj", "{2AF7986A-68F8-4EDE-9C44-1BD11ED2B329}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Selenium.WebDriver.Support", "src\support\Selenium.WebDriver.Support.csproj", "{2AF7986A-68F8-4EDE-9C44-1BD11ED2B329}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebDriver.Common.Tests", "test\common\WebDriver.Common.Tests.csproj", "{1869A2D9-3782-41E4-84DD-EB1A5E971C93}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Selenium.WebDriver.Common.Tests", "test\common\Selenium.WebDriver.Common.Tests.csproj", "{1869A2D9-3782-41E4-84DD-EB1A5E971C93}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebDriver.Chrome.Tests", "test\chrome\WebDriver.Chrome.Tests.csproj", "{F5751636-2F68-4BE3-B383-D4F4937A1946}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Selenium.WebDriver.Chrome.Tests", "test\chrome\Selenium.WebDriver.Chrome.Tests.csproj", "{F5751636-2F68-4BE3-B383-D4F4937A1946}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebDriver.Edge.Tests", "test\edge\WebDriver.Edge.Tests.csproj", "{EF99FB04-94C3-4AA0-8809-B514B253DF51}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Selenium.WebDriver.Edge.Tests", "test\edge\Selenium.WebDriver.Edge.Tests.csproj", "{EF99FB04-94C3-4AA0-8809-B514B253DF51}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebDriver.IE.Tests", "test\ie\WebDriver.IE.Tests.csproj", "{E54A6F7B-3939-4DE5-85CC-28158615A967}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Selenium.WebDriver.IE.Tests", "test\ie\Selenium.WebDriver.IE.Tests.csproj", "{E54A6F7B-3939-4DE5-85CC-28158615A967}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebDriver.Firefox.Tests", "test\firefox\WebDriver.Firefox.Tests.csproj", "{F912F647-04A0-4081-91B4-985EE0E9097C}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Selenium.WebDriver.Firefox.Tests", "test\firefox\Selenium.WebDriver.Firefox.Tests.csproj", "{F912F647-04A0-4081-91B4-985EE0E9097C}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebDriver.Remote.Tests", "test\remote\WebDriver.Remote.Tests.csproj", "{B9C6B276-445A-400F-BE74-1E068F50A54D}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Selenium.WebDriver.Remote.Tests", "test\remote\Selenium.WebDriver.Remote.Tests.csproj", "{B9C6B276-445A-400F-BE74-1E068F50A54D}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebDriver.Safari.Tests", "test\safari\WebDriver.Safari.Tests.csproj", "{BB08F673-1553-4A56-882A-A2A115AC06C2}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Selenium.WebDriver.Safari.Tests", "test\safari\Selenium.WebDriver.Safari.Tests.csproj", "{BB08F673-1553-4A56-882A-A2A115AC06C2}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebDriver.Support.Tests", "test\support\WebDriver.Support.Tests.csproj", "{2136C695-2526-45E0-AE1D-68FBBC6A9DE2}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Selenium.WebDriver.Support.Tests", "test\support\Selenium.WebDriver.Support.Tests.csproj", "{2136C695-2526-45E0-AE1D-68FBBC6A9DE2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
diff --git a/dotnet/WebDriver.snk b/dotnet/Selenium.snk
similarity index 100%
rename from dotnet/WebDriver.snk
rename to dotnet/Selenium.snk
diff --git a/dotnet/selenium-dotnet-version.bzl b/dotnet/selenium-dotnet-version.bzl
index 7c5f2f8567424..2bb599576ada7 100644
--- a/dotnet/selenium-dotnet-version.bzl
+++ b/dotnet/selenium-dotnet-version.bzl
@@ -1,12 +1,12 @@
# BUILD FILE SYNTAX: STARLARK
-SE_VERSION = "4.33.0"
+SE_VERSION = "4.34.0"
ASSEMBLY_VERSION = "4.0.0.0"
SUPPORTED_NET_STANDARD_VERSIONS = ["netstandard2.0"]
SUPPORTED_DEVTOOLS_VERSIONS = [
"v137",
- "v135",
+ "v138",
"v136",
]
diff --git a/dotnet/src/support/BUILD.bazel b/dotnet/src/support/BUILD.bazel
index 85cc060bcc324..930e842870ee8 100644
--- a/dotnet/src/support/BUILD.bazel
+++ b/dotnet/src/support/BUILD.bazel
@@ -56,7 +56,7 @@ nuget_pack(
libs = {
":support": "WebDriver.Support",
},
- nuspec_template = "WebDriver.Support.nuspec",
+ nuspec_template = "Selenium.WebDriver.Support.nuspec",
tags = [
"block-network",
],
@@ -73,7 +73,7 @@ csharp_library(
"UI/*.cs",
]) + [":assembly-info"],
out = "WebDriver.Support.StrongNamed",
- keyfile = "//dotnet:WebDriver.snk",
+ keyfile = "//dotnet:Selenium.snk",
langversion = "12.0",
nullable = "enable",
target_frameworks = [
@@ -96,7 +96,7 @@ nuget_pack(
libs = {
":support-strongnamed": "WebDriver.Support.StrongNamed",
},
- nuspec_template = "WebDriver.Support.StrongNamed.nuspec",
+ nuspec_template = "Selenium.WebDriver.Support.StrongNamed.nuspec",
tags = [
"block-network",
],
diff --git a/dotnet/src/support/WebDriver.Support.StrongNamed.nuspec b/dotnet/src/support/Selenium.WebDriver.Support.StrongNamed.nuspec
similarity index 100%
rename from dotnet/src/support/WebDriver.Support.StrongNamed.nuspec
rename to dotnet/src/support/Selenium.WebDriver.Support.StrongNamed.nuspec
diff --git a/dotnet/src/support/WebDriver.Support.csproj b/dotnet/src/support/Selenium.WebDriver.Support.csproj
similarity index 83%
rename from dotnet/src/support/WebDriver.Support.csproj
rename to dotnet/src/support/Selenium.WebDriver.Support.csproj
index 3f202568095c5..1ddf670d553c8 100644
--- a/dotnet/src/support/WebDriver.Support.csproj
+++ b/dotnet/src/support/Selenium.WebDriver.Support.csproj
@@ -32,23 +32,12 @@
true
-
-
-
-
-
-
-
-
-
-
-
..\webdriver
-
+
diff --git a/dotnet/src/support/WebDriver.Support.nuspec b/dotnet/src/support/Selenium.WebDriver.Support.nuspec
similarity index 100%
rename from dotnet/src/support/WebDriver.Support.nuspec
rename to dotnet/src/support/Selenium.WebDriver.Support.nuspec
diff --git a/dotnet/src/support/Settings.StyleCop b/dotnet/src/support/Settings.StyleCop
deleted file mode 100644
index 7dc0df8129bb6..0000000000000
--- a/dotnet/src/support/Settings.StyleCop
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
- True
-
-
-
-
-
-
- False
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/dotnet/src/support/WebDriver.Support.ruleset b/dotnet/src/support/WebDriver.Support.ruleset
deleted file mode 100644
index a4daa314c9b6f..0000000000000
--- a/dotnet/src/support/WebDriver.Support.ruleset
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/dotnet/src/webdriver/BUILD.bazel b/dotnet/src/webdriver/BUILD.bazel
index 831a8eb05734a..c18f618d9fc3f 100644
--- a/dotnet/src/webdriver/BUILD.bazel
+++ b/dotnet/src/webdriver/BUILD.bazel
@@ -103,7 +103,7 @@ csharp_library(
"**/*.cs",
]) + devtools_version_targets(),
out = "WebDriver.StrongNamed",
- keyfile = "//dotnet:WebDriver.snk",
+ keyfile = "//dotnet:Selenium.snk",
langversion = "12.0",
nullable = "enable",
resources = [
@@ -141,7 +141,7 @@ csharp_library(
defines = [
"NET8_0_OR_GREATER",
],
- keyfile = "//dotnet:WebDriver.snk",
+ keyfile = "//dotnet:Selenium.snk",
langversion = "12.0",
nullable = "enable",
resources = [
@@ -216,7 +216,7 @@ nuget_pack(
":webdriver-net8.0": "WebDriver",
":webdriver-netstandard2.0": "WebDriver",
},
- nuspec_template = "WebDriver.nuspec",
+ nuspec_template = "Selenium.WebDriver.nuspec",
tags = [
"block-network",
],
@@ -242,7 +242,7 @@ nuget_pack(
":webdriver-net8.0-strongnamed": "WebDriver.StrongNamed",
":webdriver-netstandard2.0-strongnamed": "WebDriver.StrongNamed",
},
- nuspec_template = "WebDriver.StrongNamed.nuspec",
+ nuspec_template = "Selenium.WebDriver.StrongNamed.nuspec",
property_group_vars = {
"BaseImagePath": "images",
"BaseSeleniumManagerPath": "manager",
diff --git a/dotnet/src/webdriver/BiDi/BiDi.cs b/dotnet/src/webdriver/BiDi/BiDi.cs
index 478f467012bff..9964b4e59cea8 100644
--- a/dotnet/src/webdriver/BiDi/BiDi.cs
+++ b/dotnet/src/webdriver/BiDi/BiDi.cs
@@ -27,14 +27,14 @@ public class BiDi : IAsyncDisposable
{
private readonly Broker _broker;
- private readonly Lazy _sessionModule;
- private readonly Lazy _browsingContextModule;
- private readonly Lazy _browserModule;
- private readonly Lazy _networkModule;
- private readonly Lazy _inputModule;
- private readonly Lazy _scriptModule;
- private readonly Lazy _logModule;
- private readonly Lazy _storageModule;
+ private readonly Lazy _sessionModule;
+ private readonly Lazy _browsingContextModule;
+ private readonly Lazy _browserModule;
+ private readonly Lazy _networkModule;
+ private readonly Lazy _inputModule;
+ private readonly Lazy _scriptModule;
+ private readonly Lazy _logModule;
+ private readonly Lazy _storageModule;
internal BiDi(string url)
{
@@ -42,26 +42,26 @@ internal BiDi(string url)
_broker = new Broker(this, uri);
- _sessionModule = new Lazy(() => new Modules.Session.SessionModule(_broker));
- _browsingContextModule = new Lazy(() => new Modules.BrowsingContext.BrowsingContextModule(_broker));
- _browserModule = new Lazy(() => new Modules.Browser.BrowserModule(_broker));
- _networkModule = new Lazy(() => new Modules.Network.NetworkModule(_broker));
- _inputModule = new Lazy(() => new Modules.Input.InputModule(_broker));
- _scriptModule = new Lazy(() => new Modules.Script.ScriptModule(_broker));
- _logModule = new Lazy(() => new Modules.Log.LogModule(_broker));
- _storageModule = new Lazy(() => new Modules.Storage.StorageModule(_broker));
+ _sessionModule = new Lazy(() => new Session.SessionModule(_broker));
+ _browsingContextModule = new Lazy(() => new BrowsingContext.BrowsingContextModule(_broker));
+ _browserModule = new Lazy(() => new Browser.BrowserModule(_broker));
+ _networkModule = new Lazy(() => new Network.NetworkModule(_broker));
+ _inputModule = new Lazy(() => new Input.InputModule(_broker));
+ _scriptModule = new Lazy(() => new Script.ScriptModule(_broker));
+ _logModule = new Lazy(() => new Log.LogModule(_broker));
+ _storageModule = new Lazy(() => new Storage.StorageModule(_broker));
}
- internal Modules.Session.SessionModule SessionModule => _sessionModule.Value;
- public Modules.BrowsingContext.BrowsingContextModule BrowsingContext => _browsingContextModule.Value;
- public Modules.Browser.BrowserModule Browser => _browserModule.Value;
- public Modules.Network.NetworkModule Network => _networkModule.Value;
- internal Modules.Input.InputModule InputModule => _inputModule.Value;
- public Modules.Script.ScriptModule Script => _scriptModule.Value;
- public Modules.Log.LogModule Log => _logModule.Value;
- public Modules.Storage.StorageModule Storage => _storageModule.Value;
+ internal Session.SessionModule SessionModule => _sessionModule.Value;
+ public BrowsingContext.BrowsingContextModule BrowsingContext => _browsingContextModule.Value;
+ public Browser.BrowserModule Browser => _browserModule.Value;
+ public Network.NetworkModule Network => _networkModule.Value;
+ internal Input.InputModule InputModule => _inputModule.Value;
+ public Script.ScriptModule Script => _scriptModule.Value;
+ public Log.LogModule Log => _logModule.Value;
+ public Storage.StorageModule Storage => _storageModule.Value;
- public Task StatusAsync()
+ public Task StatusAsync()
{
return SessionModule.StatusAsync();
}
@@ -75,7 +75,7 @@ public static async Task ConnectAsync(string url)
return bidi;
}
- public Task EndAsync(Modules.Session.EndOptions? options = null)
+ public Task EndAsync(Session.EndOptions? options = null)
{
return SessionModule.EndAsync(options);
}
diff --git a/dotnet/src/webdriver/BiDi/Modules/Browser/BrowserModule.cs b/dotnet/src/webdriver/BiDi/Browser/BrowserModule.cs
similarity index 90%
rename from dotnet/src/webdriver/BiDi/Modules/Browser/BrowserModule.cs
rename to dotnet/src/webdriver/BiDi/Browser/BrowserModule.cs
index 822fbe26ae33d..51ce4e082a0de 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Browser/BrowserModule.cs
+++ b/dotnet/src/webdriver/BiDi/Browser/BrowserModule.cs
@@ -17,11 +17,10 @@
// under the License.
//
-using System.Collections.Generic;
using System.Threading.Tasks;
using OpenQA.Selenium.BiDi.Communication;
-namespace OpenQA.Selenium.BiDi.Modules.Browser;
+namespace OpenQA.Selenium.BiDi.Browser;
public sealed class BrowserModule(Broker broker) : Module(broker)
{
@@ -32,7 +31,9 @@ public async Task CloseAsync(CloseOptions? options = null)
public async Task CreateUserContextAsync(CreateUserContextOptions? options = null)
{
- return await Broker.ExecuteCommandAsync(new CreateUserContextCommand(), options).ConfigureAwait(false);
+ var @params = new CreateUserContextCommandParameters(options?.AcceptInsecureCerts, options?.Proxy);
+
+ return await Broker.ExecuteCommandAsync(new CreateUserContextCommand(@params), options).ConfigureAwait(false);
}
public async Task GetUserContextsAsync(GetUserContextsOptions? options = null)
diff --git a/dotnet/src/webdriver/BiDi/Modules/Browser/ClientWindow.cs b/dotnet/src/webdriver/BiDi/Browser/ClientWindow.cs
similarity index 92%
rename from dotnet/src/webdriver/BiDi/Modules/Browser/ClientWindow.cs
rename to dotnet/src/webdriver/BiDi/Browser/ClientWindow.cs
index fe80e23374bd3..44387a5d67441 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Browser/ClientWindow.cs
+++ b/dotnet/src/webdriver/BiDi/Browser/ClientWindow.cs
@@ -17,9 +17,9 @@
// under the License.
//
-namespace OpenQA.Selenium.BiDi.Modules.Browser;
+namespace OpenQA.Selenium.BiDi.Browser;
-public record ClientWindow
+public sealed record ClientWindow
{
internal ClientWindow(string id)
{
diff --git a/dotnet/src/webdriver/BiDi/Modules/Browser/ClientWindowInfo.cs b/dotnet/src/webdriver/BiDi/Browser/ClientWindowInfo.cs
similarity index 84%
rename from dotnet/src/webdriver/BiDi/Modules/Browser/ClientWindowInfo.cs
rename to dotnet/src/webdriver/BiDi/Browser/ClientWindowInfo.cs
index 49478b69d3846..d097e14ded209 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Browser/ClientWindowInfo.cs
+++ b/dotnet/src/webdriver/BiDi/Browser/ClientWindowInfo.cs
@@ -17,9 +17,9 @@
// under the License.
//
-namespace OpenQA.Selenium.BiDi.Modules.Browser;
+namespace OpenQA.Selenium.BiDi.Browser;
-public record ClientWindowInfo(bool Active, ClientWindow ClientWindow, ClientWindowState State, int Height, int Width, int X, int Y);
+public sealed record ClientWindowInfo(bool Active, ClientWindow ClientWindow, ClientWindowState State, int Height, int Width, int X, int Y);
public enum ClientWindowState
{
diff --git a/dotnet/src/webdriver/BiDi/Modules/Browser/CloseCommand.cs b/dotnet/src/webdriver/BiDi/Browser/CloseCommand.cs
similarity index 88%
rename from dotnet/src/webdriver/BiDi/Modules/Browser/CloseCommand.cs
rename to dotnet/src/webdriver/BiDi/Browser/CloseCommand.cs
index fe29a937ec4d4..67f6a3e0d29e9 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Browser/CloseCommand.cs
+++ b/dotnet/src/webdriver/BiDi/Browser/CloseCommand.cs
@@ -19,9 +19,9 @@
using OpenQA.Selenium.BiDi.Communication;
-namespace OpenQA.Selenium.BiDi.Modules.Browser;
+namespace OpenQA.Selenium.BiDi.Browser;
-internal class CloseCommand()
+internal sealed class CloseCommand()
: Command(CommandParameters.Empty, "browser.close");
-public record CloseOptions : CommandOptions;
+public sealed class CloseOptions : CommandOptions;
diff --git a/dotnet/src/webdriver/BiDi/Browser/CreateUserContextCommand.cs b/dotnet/src/webdriver/BiDi/Browser/CreateUserContextCommand.cs
new file mode 100644
index 0000000000000..278dd44009cba
--- /dev/null
+++ b/dotnet/src/webdriver/BiDi/Browser/CreateUserContextCommand.cs
@@ -0,0 +1,34 @@
+//
+// Licensed to the Software Freedom Conservancy (SFC) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The SFC licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+
+using OpenQA.Selenium.BiDi.Communication;
+
+namespace OpenQA.Selenium.BiDi.Browser;
+
+internal sealed class CreateUserContextCommand(CreateUserContextCommandParameters @params)
+ : Command(@params, "browser.createUserContext");
+
+internal sealed record CreateUserContextCommandParameters(bool? AcceptInsecureCerts, Session.ProxyConfiguration? Proxy) : CommandParameters;
+
+public sealed class CreateUserContextOptions : CommandOptions
+{
+ public bool? AcceptInsecureCerts { get; set; }
+
+ public Session.ProxyConfiguration? Proxy { get; set; }
+}
diff --git a/dotnet/src/webdriver/BiDi/Modules/Browser/GetClientWindowsCommand.cs b/dotnet/src/webdriver/BiDi/Browser/GetClientWindowsCommand.cs
similarity index 87%
rename from dotnet/src/webdriver/BiDi/Modules/Browser/GetClientWindowsCommand.cs
rename to dotnet/src/webdriver/BiDi/Browser/GetClientWindowsCommand.cs
index 5e6f4f2b65d30..b4d1228f4e26f 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Browser/GetClientWindowsCommand.cs
+++ b/dotnet/src/webdriver/BiDi/Browser/GetClientWindowsCommand.cs
@@ -21,14 +21,14 @@
using System.Collections;
using System.Collections.Generic;
-namespace OpenQA.Selenium.BiDi.Modules.Browser;
+namespace OpenQA.Selenium.BiDi.Browser;
-internal class GetClientWindowsCommand()
+internal sealed class GetClientWindowsCommand()
: Command(CommandParameters.Empty, "browser.getClientWindows");
-public record GetClientWindowsOptions : CommandOptions;
+public sealed class GetClientWindowsOptions : CommandOptions;
-public record GetClientWindowsResult : EmptyResult, IReadOnlyList
+public sealed record GetClientWindowsResult : EmptyResult, IReadOnlyList
{
private readonly IReadOnlyList _clientWindows;
diff --git a/dotnet/src/webdriver/BiDi/Modules/Browser/GetUserContextsCommand.cs b/dotnet/src/webdriver/BiDi/Browser/GetUserContextsCommand.cs
similarity index 87%
rename from dotnet/src/webdriver/BiDi/Modules/Browser/GetUserContextsCommand.cs
rename to dotnet/src/webdriver/BiDi/Browser/GetUserContextsCommand.cs
index 42891aa3664ba..b6efce675434c 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Browser/GetUserContextsCommand.cs
+++ b/dotnet/src/webdriver/BiDi/Browser/GetUserContextsCommand.cs
@@ -21,14 +21,14 @@
using System.Collections;
using System.Collections.Generic;
-namespace OpenQA.Selenium.BiDi.Modules.Browser;
+namespace OpenQA.Selenium.BiDi.Browser;
-internal class GetUserContextsCommand()
+internal sealed class GetUserContextsCommand()
: Command(CommandParameters.Empty, "browser.getUserContexts");
-public record GetUserContextsOptions : CommandOptions;
+public class GetUserContextsOptions : CommandOptions;
-public record GetUserContextsResult : EmptyResult, IReadOnlyList
+public sealed record GetUserContextsResult : EmptyResult, IReadOnlyList
{
private readonly IReadOnlyList _userContexts;
diff --git a/dotnet/src/webdriver/BiDi/Modules/Browser/RemoveUserContextCommand.cs b/dotnet/src/webdriver/BiDi/Browser/RemoveUserContextCommand.cs
similarity index 77%
rename from dotnet/src/webdriver/BiDi/Modules/Browser/RemoveUserContextCommand.cs
rename to dotnet/src/webdriver/BiDi/Browser/RemoveUserContextCommand.cs
index 7dcfe38c7bb0a..feaf1e820600c 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Browser/RemoveUserContextCommand.cs
+++ b/dotnet/src/webdriver/BiDi/Browser/RemoveUserContextCommand.cs
@@ -19,11 +19,11 @@
using OpenQA.Selenium.BiDi.Communication;
-namespace OpenQA.Selenium.BiDi.Modules.Browser;
+namespace OpenQA.Selenium.BiDi.Browser;
-internal class RemoveUserContextCommand(RemoveUserContextCommandParameters @params)
+internal sealed class RemoveUserContextCommand(RemoveUserContextCommandParameters @params)
: Command(@params, "browser.removeUserContext");
-internal record RemoveUserContextCommandParameters(UserContext UserContext) : CommandParameters;
+internal sealed record RemoveUserContextCommandParameters(UserContext UserContext) : CommandParameters;
-public record RemoveUserContextOptions : CommandOptions;
+public sealed class RemoveUserContextOptions : CommandOptions;
diff --git a/dotnet/src/webdriver/BiDi/Modules/Browser/UserContext.cs b/dotnet/src/webdriver/BiDi/Browser/UserContext.cs
similarity index 94%
rename from dotnet/src/webdriver/BiDi/Modules/Browser/UserContext.cs
rename to dotnet/src/webdriver/BiDi/Browser/UserContext.cs
index ad00ef278a20c..6f7bc3f8dab5d 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Browser/UserContext.cs
+++ b/dotnet/src/webdriver/BiDi/Browser/UserContext.cs
@@ -20,9 +20,9 @@
using System;
using System.Threading.Tasks;
-namespace OpenQA.Selenium.BiDi.Modules.Browser;
+namespace OpenQA.Selenium.BiDi.Browser;
-public class UserContext : IAsyncDisposable
+public sealed class UserContext : IAsyncDisposable
{
private readonly BiDi _bidi;
diff --git a/dotnet/src/webdriver/BiDi/Modules/Browser/UserContextInfo.cs b/dotnet/src/webdriver/BiDi/Browser/UserContextInfo.cs
similarity index 88%
rename from dotnet/src/webdriver/BiDi/Modules/Browser/UserContextInfo.cs
rename to dotnet/src/webdriver/BiDi/Browser/UserContextInfo.cs
index f439f678b3f64..7440624658b1f 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Browser/UserContextInfo.cs
+++ b/dotnet/src/webdriver/BiDi/Browser/UserContextInfo.cs
@@ -19,6 +19,6 @@
using OpenQA.Selenium.BiDi.Communication;
-namespace OpenQA.Selenium.BiDi.Modules.Browser;
+namespace OpenQA.Selenium.BiDi.Browser;
-public record UserContextInfo(UserContext UserContext) : EmptyResult;
+public sealed record UserContextInfo(UserContext UserContext) : EmptyResult;
diff --git a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/ActivateCommand.cs b/dotnet/src/webdriver/BiDi/BrowsingContext/ActivateCommand.cs
similarity index 79%
rename from dotnet/src/webdriver/BiDi/Modules/BrowsingContext/ActivateCommand.cs
rename to dotnet/src/webdriver/BiDi/BrowsingContext/ActivateCommand.cs
index 9b091965f8c21..59aae1197767b 100644
--- a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/ActivateCommand.cs
+++ b/dotnet/src/webdriver/BiDi/BrowsingContext/ActivateCommand.cs
@@ -19,11 +19,11 @@
using OpenQA.Selenium.BiDi.Communication;
-namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;
+namespace OpenQA.Selenium.BiDi.BrowsingContext;
-internal class ActivateCommand(ActivateCommandParameters @params)
+internal sealed class ActivateCommand(ActivateCommandParameters @params)
: Command(@params, "browsingContext.activate");
-internal record ActivateCommandParameters(BrowsingContext Context) : CommandParameters;
+internal sealed record ActivateCommandParameters(BrowsingContext Context) : CommandParameters;
-public record ActivateOptions : CommandOptions;
+public sealed class ActivateOptions : CommandOptions;
diff --git a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContext.cs b/dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContext.cs
similarity index 93%
rename from dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContext.cs
rename to dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContext.cs
index 0313af37afd73..11232a165d093 100644
--- a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContext.cs
+++ b/dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContext.cs
@@ -21,9 +21,9 @@
using System.Threading.Tasks;
using System;
-namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;
+namespace OpenQA.Selenium.BiDi.BrowsingContext;
-public class BrowsingContext
+public sealed class BrowsingContext
{
internal BrowsingContext(BiDi bidi, string id)
{
@@ -147,6 +147,16 @@ public Task OnFragmentNavigatedAsync(Action handle
return BiDi.BrowsingContext.OnFragmentNavigatedAsync(handler, new BrowsingContextsSubscriptionOptions(options) { Contexts = [this] });
}
+ public Task OnHistoryUpdatedAsync(Func handler, SubscriptionOptions? options = null)
+ {
+ return BiDi.BrowsingContext.OnHistoryUpdatedAsync(handler, new BrowsingContextsSubscriptionOptions(options) { Contexts = [this] });
+ }
+
+ public Task OnHistoryUpdatedAsync(Action handler, SubscriptionOptions? options = null)
+ {
+ return BiDi.BrowsingContext.OnHistoryUpdatedAsync(handler, new BrowsingContextsSubscriptionOptions(options) { Contexts = [this] });
+ }
+
public Task OnDomContentLoadedAsync(Func handler, SubscriptionOptions? options = null)
{
return BiDi.BrowsingContext.OnDomContentLoadedAsync(handler, new BrowsingContextsSubscriptionOptions(options) { Contexts = [this] });
diff --git a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextInfo.cs b/dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContextInfo.cs
similarity index 75%
rename from dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextInfo.cs
rename to dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContextInfo.cs
index 7b42bc9f677a0..271aefc1310c7 100644
--- a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextInfo.cs
+++ b/dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContextInfo.cs
@@ -20,10 +20,9 @@
using System.Collections.Generic;
using System.Text.Json.Serialization;
-namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;
+namespace OpenQA.Selenium.BiDi.BrowsingContext;
-// TODO: Split it to separate class with just info and event args
-public record BrowsingContextInfo(BiDi BiDi, IReadOnlyList Children, Browser.ClientWindow ClientWindow, BrowsingContext Context, BrowsingContext OriginalOpener, string Url, Browser.UserContext UserContext)
+public sealed record BrowsingContextInfo(BiDi BiDi, IReadOnlyList? Children, Browser.ClientWindow ClientWindow, BrowsingContext Context, BrowsingContext? OriginalOpener, string Url, Browser.UserContext UserContext)
: BrowsingContextEventArgs(BiDi, Context)
{
[JsonInclude]
diff --git a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextInputModule.cs b/dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContextInputModule.cs
similarity index 89%
rename from dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextInputModule.cs
rename to dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContextInputModule.cs
index c4bb5f28fefe2..3d78a4fd4e16b 100644
--- a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextInputModule.cs
+++ b/dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContextInputModule.cs
@@ -18,12 +18,12 @@
//
using System.Threading.Tasks;
-using OpenQA.Selenium.BiDi.Modules.Input;
+using OpenQA.Selenium.BiDi.Input;
using System.Collections.Generic;
-namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;
+namespace OpenQA.Selenium.BiDi.BrowsingContext;
-public class BrowsingContextInputModule(BrowsingContext context, InputModule inputModule)
+public sealed class BrowsingContextInputModule(BrowsingContext context, InputModule inputModule)
{
public Task PerformActionsAsync(IEnumerable actions, PerformActionsOptions? options = null)
{
diff --git a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextLogModule.cs b/dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContextLogModule.cs
similarity index 90%
rename from dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextLogModule.cs
rename to dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContextLogModule.cs
index f70473c50dea6..d98fe04948631 100644
--- a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextLogModule.cs
+++ b/dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContextLogModule.cs
@@ -17,13 +17,13 @@
// under the License.
//
-using OpenQA.Selenium.BiDi.Modules.Log;
+using OpenQA.Selenium.BiDi.Log;
using System.Threading.Tasks;
using System;
-namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;
+namespace OpenQA.Selenium.BiDi.BrowsingContext;
-public class BrowsingContextLogModule(BrowsingContext context, LogModule logModule)
+public sealed class BrowsingContextLogModule(BrowsingContext context, LogModule logModule)
{
public Task OnEntryAddedAsync(Func handler, SubscriptionOptions? options = null)
{
diff --git a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextModule.cs b/dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContextModule.cs
similarity index 94%
rename from dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextModule.cs
rename to dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContextModule.cs
index 369325323bd11..7db46b952e15b 100644
--- a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextModule.cs
+++ b/dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContextModule.cs
@@ -22,9 +22,9 @@
using System.Threading.Tasks;
using OpenQA.Selenium.BiDi.Communication;
-namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;
+namespace OpenQA.Selenium.BiDi.BrowsingContext;
-public class BrowsingContextModule(Broker broker) : Module(broker)
+public sealed class BrowsingContextModule(Broker broker) : Module(broker)
{
public async Task CreateAsync(ContextType type, CreateOptions? options = null)
{
@@ -134,6 +134,16 @@ public async Task OnFragmentNavigatedAsync(Action
return await Broker.SubscribeAsync("browsingContext.fragmentNavigated", handler, options).ConfigureAwait(false);
}
+ public async Task OnHistoryUpdatedAsync(Func handler, BrowsingContextsSubscriptionOptions? options = null)
+ {
+ return await Broker.SubscribeAsync("browsingContext.historyUpdated", handler, options).ConfigureAwait(false);
+ }
+
+ public async Task OnHistoryUpdatedAsync(Action handler, BrowsingContextsSubscriptionOptions? options = null)
+ {
+ return await Broker.SubscribeAsync("browsingContext.historyUpdated", handler, options).ConfigureAwait(false);
+ }
+
public async Task OnDomContentLoadedAsync(Func handler, BrowsingContextsSubscriptionOptions? options = null)
{
return await Broker.SubscribeAsync("browsingContext.domContentLoaded", handler, options).ConfigureAwait(false);
diff --git a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextNetworkModule.cs b/dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContextNetworkModule.cs
similarity index 93%
rename from dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextNetworkModule.cs
rename to dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContextNetworkModule.cs
index 13c31ba2cea59..9883532c90938 100644
--- a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextNetworkModule.cs
+++ b/dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContextNetworkModule.cs
@@ -19,11 +19,11 @@
using System.Threading.Tasks;
using System;
-using OpenQA.Selenium.BiDi.Modules.Network;
+using OpenQA.Selenium.BiDi.Network;
-namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;
+namespace OpenQA.Selenium.BiDi.BrowsingContext;
-public class BrowsingContextNetworkModule(BrowsingContext context, NetworkModule networkModule)
+public sealed class BrowsingContextNetworkModule(BrowsingContext context, NetworkModule networkModule)
{
public async Task InterceptRequestAsync(Func handler, InterceptRequestOptions? options = null)
{
@@ -134,8 +134,8 @@ public Task OnAuthRequiredAsync(Action hand
}
}
-public record InterceptRequestOptions : BrowsingContextAddInterceptOptions;
+public sealed record InterceptRequestOptions : BrowsingContextAddInterceptOptions;
-public record InterceptResponseOptions : BrowsingContextAddInterceptOptions;
+public sealed record InterceptResponseOptions : BrowsingContextAddInterceptOptions;
-public record InterceptAuthOptions : BrowsingContextAddInterceptOptions;
+public sealed record InterceptAuthOptions : BrowsingContextAddInterceptOptions;
diff --git a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextScriptModule.cs b/dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContextScriptModule.cs
similarity index 94%
rename from dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextScriptModule.cs
rename to dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContextScriptModule.cs
index 53b319042fd4e..5d9d279fe5059 100644
--- a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextScriptModule.cs
+++ b/dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContextScriptModule.cs
@@ -18,12 +18,12 @@
//
using System.Threading.Tasks;
-using OpenQA.Selenium.BiDi.Modules.Script;
+using OpenQA.Selenium.BiDi.Script;
using System.Collections.Generic;
-namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;
+namespace OpenQA.Selenium.BiDi.BrowsingContext;
-public class BrowsingContextScriptModule(BrowsingContext context, ScriptModule scriptModule)
+public sealed class BrowsingContextScriptModule(BrowsingContext context, ScriptModule scriptModule)
{
public async Task AddPreloadScriptAsync(string functionDeclaration, BrowsingContextAddPreloadScriptOptions? options = null)
{
diff --git a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextStorageModule.cs b/dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContextStorageModule.cs
similarity index 90%
rename from dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextStorageModule.cs
rename to dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContextStorageModule.cs
index 2be053ed7226d..1aa8ffd812f9a 100644
--- a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextStorageModule.cs
+++ b/dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContextStorageModule.cs
@@ -18,11 +18,11 @@
//
using System.Threading.Tasks;
-using OpenQA.Selenium.BiDi.Modules.Storage;
+using OpenQA.Selenium.BiDi.Storage;
-namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;
+namespace OpenQA.Selenium.BiDi.BrowsingContext;
-public class BrowsingContextStorageModule(BrowsingContext context, StorageModule storageModule)
+public sealed class BrowsingContextStorageModule(BrowsingContext context, StorageModule storageModule)
{
public Task GetCookiesAsync(GetCookiesOptions? options = null)
{
diff --git a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/CaptureScreenshotCommand.cs b/dotnet/src/webdriver/BiDi/BrowsingContext/CaptureScreenshotCommand.cs
similarity index 68%
rename from dotnet/src/webdriver/BiDi/Modules/BrowsingContext/CaptureScreenshotCommand.cs
rename to dotnet/src/webdriver/BiDi/BrowsingContext/CaptureScreenshotCommand.cs
index f5d6af884ac3f..6fa5149b10646 100644
--- a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/CaptureScreenshotCommand.cs
+++ b/dotnet/src/webdriver/BiDi/BrowsingContext/CaptureScreenshotCommand.cs
@@ -20,14 +20,14 @@
using OpenQA.Selenium.BiDi.Communication;
using System.Text.Json.Serialization;
-namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;
+namespace OpenQA.Selenium.BiDi.BrowsingContext;
-internal class CaptureScreenshotCommand(CaptureScreenshotCommandParameters @params)
+internal sealed class CaptureScreenshotCommand(CaptureScreenshotCommandParameters @params)
: Command(@params, "browsingContext.captureScreenshot");
-internal record CaptureScreenshotCommandParameters(BrowsingContext Context, ScreenshotOrigin? Origin, ImageFormat? Format, ClipRectangle? Clip) : CommandParameters;
+internal sealed record CaptureScreenshotCommandParameters(BrowsingContext Context, ScreenshotOrigin? Origin, ImageFormat? Format, ClipRectangle? Clip) : CommandParameters;
-public record CaptureScreenshotOptions : CommandOptions
+public sealed class CaptureScreenshotOptions : CommandOptions
{
public ScreenshotOrigin? Origin { get; set; }
@@ -52,11 +52,13 @@ public record struct ImageFormat(string Type)
[JsonDerivedType(typeof(ElementClipRectangle), "element")]
public abstract record ClipRectangle;
-public record BoxClipRectangle(double X, double Y, double Width, double Height) : ClipRectangle;
+public sealed record BoxClipRectangle(double X, double Y, double Width, double Height) : ClipRectangle;
-public record ElementClipRectangle(Script.ISharedReference Element) : ClipRectangle;
+public sealed record ElementClipRectangle(Script.ISharedReference Element) : ClipRectangle;
-public record CaptureScreenshotResult(string Data) : EmptyResult
+public sealed record CaptureScreenshotResult(string Data) : EmptyResult
{
+ public static implicit operator byte[](CaptureScreenshotResult captureScreenshotResult) => captureScreenshotResult.ToByteArray();
+
public byte[] ToByteArray() => System.Convert.FromBase64String(Data);
}
diff --git a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/CloseCommand.cs b/dotnet/src/webdriver/BiDi/BrowsingContext/CloseCommand.cs
similarity index 79%
rename from dotnet/src/webdriver/BiDi/Modules/BrowsingContext/CloseCommand.cs
rename to dotnet/src/webdriver/BiDi/BrowsingContext/CloseCommand.cs
index 7d7d5c6beb5c5..69f207189ae70 100644
--- a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/CloseCommand.cs
+++ b/dotnet/src/webdriver/BiDi/BrowsingContext/CloseCommand.cs
@@ -19,14 +19,14 @@
using OpenQA.Selenium.BiDi.Communication;
-namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;
+namespace OpenQA.Selenium.BiDi.BrowsingContext;
-internal class CloseCommand(CloseCommandParameters @params)
+internal sealed class CloseCommand(CloseCommandParameters @params)
: Command(@params, "browsingContext.close");
-internal record CloseCommandParameters(BrowsingContext Context, bool? PromptUnload) : CommandParameters;
+internal sealed record CloseCommandParameters(BrowsingContext Context, bool? PromptUnload) : CommandParameters;
-public record CloseOptions : CommandOptions
+public sealed class CloseOptions : CommandOptions
{
public bool? PromptUnload { get; set; }
}
diff --git a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/CreateCommand.cs b/dotnet/src/webdriver/BiDi/BrowsingContext/CreateCommand.cs
similarity index 74%
rename from dotnet/src/webdriver/BiDi/Modules/BrowsingContext/CreateCommand.cs
rename to dotnet/src/webdriver/BiDi/BrowsingContext/CreateCommand.cs
index 58900de151e51..2e3881a393b6e 100644
--- a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/CreateCommand.cs
+++ b/dotnet/src/webdriver/BiDi/BrowsingContext/CreateCommand.cs
@@ -19,14 +19,14 @@
using OpenQA.Selenium.BiDi.Communication;
-namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;
+namespace OpenQA.Selenium.BiDi.BrowsingContext;
-internal class CreateCommand(CreateCommandParameters @params)
+internal sealed class CreateCommand(CreateCommandParameters @params)
: Command(@params, "browsingContext.create");
-internal record CreateCommandParameters(ContextType Type, BrowsingContext? ReferenceContext, bool? Background, Browser.UserContext? UserContext) : CommandParameters;
+internal sealed record CreateCommandParameters(ContextType Type, BrowsingContext? ReferenceContext, bool? Background, Browser.UserContext? UserContext) : CommandParameters;
-public record CreateOptions : CommandOptions
+public sealed class CreateOptions : CommandOptions
{
public BrowsingContext? ReferenceContext { get; set; }
@@ -41,4 +41,4 @@ public enum ContextType
Window
}
-public record CreateResult(BrowsingContext Context) : EmptyResult;
+public sealed record CreateResult(BrowsingContext Context) : EmptyResult;
diff --git a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/GetTreeCommand.cs b/dotnet/src/webdriver/BiDi/BrowsingContext/GetTreeCommand.cs
similarity index 76%
rename from dotnet/src/webdriver/BiDi/Modules/BrowsingContext/GetTreeCommand.cs
rename to dotnet/src/webdriver/BiDi/BrowsingContext/GetTreeCommand.cs
index 0c6e0d7dd777a..0a0aef4dc75f4 100644
--- a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/GetTreeCommand.cs
+++ b/dotnet/src/webdriver/BiDi/BrowsingContext/GetTreeCommand.cs
@@ -20,14 +20,14 @@
using OpenQA.Selenium.BiDi.Communication;
using System.Collections.Generic;
-namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;
+namespace OpenQA.Selenium.BiDi.BrowsingContext;
-internal class GetTreeCommand(GetTreeCommandParameters @params)
+internal sealed class GetTreeCommand(GetTreeCommandParameters @params)
: Command(@params, "browsingContext.getTree");
-internal record GetTreeCommandParameters(long? MaxDepth, BrowsingContext? Root) : CommandParameters;
+internal sealed record GetTreeCommandParameters(long? MaxDepth, BrowsingContext? Root) : CommandParameters;
-public record GetTreeOptions : CommandOptions
+public sealed class GetTreeOptions : CommandOptions
{
public GetTreeOptions() { }
@@ -41,9 +41,9 @@ internal GetTreeOptions(BrowsingContextGetTreeOptions? options)
public BrowsingContext? Root { get; set; }
}
-public record BrowsingContextGetTreeOptions
+public sealed record BrowsingContextGetTreeOptions
{
public long? MaxDepth { get; set; }
}
-public record GetTreeResult(IReadOnlyList Contexts) : EmptyResult;
+public sealed record GetTreeResult(IReadOnlyList Contexts) : EmptyResult;
diff --git a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/HandleUserPromptCommand.cs b/dotnet/src/webdriver/BiDi/BrowsingContext/HandleUserPromptCommand.cs
similarity index 77%
rename from dotnet/src/webdriver/BiDi/Modules/BrowsingContext/HandleUserPromptCommand.cs
rename to dotnet/src/webdriver/BiDi/BrowsingContext/HandleUserPromptCommand.cs
index cd76961c4cf7f..6c01767d65a02 100644
--- a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/HandleUserPromptCommand.cs
+++ b/dotnet/src/webdriver/BiDi/BrowsingContext/HandleUserPromptCommand.cs
@@ -19,14 +19,14 @@
using OpenQA.Selenium.BiDi.Communication;
-namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;
+namespace OpenQA.Selenium.BiDi.BrowsingContext;
-class HandleUserPromptCommand(HandleUserPromptCommandParameters @params)
+internal sealed class HandleUserPromptCommand(HandleUserPromptCommandParameters @params)
: Command(@params, "browsingContext.handleUserPrompt");
-internal record HandleUserPromptCommandParameters(BrowsingContext Context, bool? Accept, string? UserText) : CommandParameters;
+internal sealed record HandleUserPromptCommandParameters(BrowsingContext Context, bool? Accept, string? UserText) : CommandParameters;
-public record HandleUserPromptOptions : CommandOptions
+public sealed class HandleUserPromptOptions : CommandOptions
{
public bool? Accept { get; set; }
diff --git a/dotnet/src/webdriver/BiDi/BrowsingContext/HistoryUpdatedEventArgs.cs b/dotnet/src/webdriver/BiDi/BrowsingContext/HistoryUpdatedEventArgs.cs
new file mode 100644
index 0000000000000..492b66a0a4e4f
--- /dev/null
+++ b/dotnet/src/webdriver/BiDi/BrowsingContext/HistoryUpdatedEventArgs.cs
@@ -0,0 +1,25 @@
+//
+// Licensed to the Software Freedom Conservancy (SFC) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The SFC licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+
+using System;
+
+namespace OpenQA.Selenium.BiDi.BrowsingContext;
+
+public sealed record HistoryUpdatedEventArgs(BiDi BiDi, BrowsingContext Context, DateTimeOffset Timestamp, string Url)
+ : BrowsingContextEventArgs(BiDi, Context);
diff --git a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/LocateNodesCommand.cs b/dotnet/src/webdriver/BiDi/BrowsingContext/LocateNodesCommand.cs
similarity index 77%
rename from dotnet/src/webdriver/BiDi/Modules/BrowsingContext/LocateNodesCommand.cs
rename to dotnet/src/webdriver/BiDi/BrowsingContext/LocateNodesCommand.cs
index 393cdff1c9e22..a8efd228e1b69 100644
--- a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/LocateNodesCommand.cs
+++ b/dotnet/src/webdriver/BiDi/BrowsingContext/LocateNodesCommand.cs
@@ -21,14 +21,14 @@
using System.Collections;
using System.Collections.Generic;
-namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;
+namespace OpenQA.Selenium.BiDi.BrowsingContext;
-internal class LocateNodesCommand(LocateNodesCommandParameters @params)
+internal sealed class LocateNodesCommand(LocateNodesCommandParameters @params)
: Command(@params, "browsingContext.locateNodes");
-internal record LocateNodesCommandParameters(BrowsingContext Context, Locator Locator, long? MaxNodeCount, Script.SerializationOptions? SerializationOptions, IEnumerable? StartNodes) : CommandParameters;
+internal sealed record LocateNodesCommandParameters(BrowsingContext Context, Locator Locator, long? MaxNodeCount, Script.SerializationOptions? SerializationOptions, IEnumerable? StartNodes) : CommandParameters;
-public record LocateNodesOptions : CommandOptions
+public sealed class LocateNodesOptions : CommandOptions
{
public long? MaxNodeCount { get; set; }
@@ -37,7 +37,7 @@ public record LocateNodesOptions : CommandOptions
public IEnumerable? StartNodes { get; set; }
}
-public record LocateNodesResult : EmptyResult, IReadOnlyList
+public sealed record LocateNodesResult : EmptyResult, IReadOnlyList
{
private readonly IReadOnlyList _nodes;
diff --git a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/Locator.cs b/dotnet/src/webdriver/BiDi/BrowsingContext/Locator.cs
similarity index 76%
rename from dotnet/src/webdriver/BiDi/Modules/BrowsingContext/Locator.cs
rename to dotnet/src/webdriver/BiDi/BrowsingContext/Locator.cs
index c1c6f63405bc4..b0aef53821dbf 100644
--- a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/Locator.cs
+++ b/dotnet/src/webdriver/BiDi/BrowsingContext/Locator.cs
@@ -19,7 +19,7 @@
using System.Text.Json.Serialization;
-namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;
+namespace OpenQA.Selenium.BiDi.BrowsingContext;
[JsonPolymorphic(TypeDiscriminatorPropertyName = "type")]
[JsonDerivedType(typeof(AccessibilityLocator), "accessibility")]
@@ -29,13 +29,13 @@ namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;
[JsonDerivedType(typeof(XPathLocator), "xpath")]
public abstract record Locator;
-public record AccessibilityLocator(AccessibilityValue Value) : Locator;
+public sealed record AccessibilityLocator(AccessibilityValue Value) : Locator;
-public record CssLocator(string Value) : Locator;
+public sealed record CssLocator(string Value) : Locator;
-public record ContextLocator(ContextValue Value) : Locator;
+public sealed record ContextLocator(ContextValue Value) : Locator;
-public record InnerTextLocator(string Value) : Locator
+public sealed record InnerTextLocator(string Value) : Locator
{
public bool? IgnoreCase { get; set; }
@@ -44,15 +44,15 @@ public record InnerTextLocator(string Value) : Locator
public long? MaxDepth { get; set; }
}
-public record XPathLocator(string Value) : Locator;
+public sealed record XPathLocator(string Value) : Locator;
-public record AccessibilityValue
+public sealed record AccessibilityValue
{
public string? Name { get; set; }
public string? Role { get; set; }
}
-public record ContextValue(BrowsingContext Context);
+public sealed record ContextValue(BrowsingContext Context);
public enum MatchType
{
diff --git a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/NavigateCommand.cs b/dotnet/src/webdriver/BiDi/BrowsingContext/NavigateCommand.cs
similarity index 74%
rename from dotnet/src/webdriver/BiDi/Modules/BrowsingContext/NavigateCommand.cs
rename to dotnet/src/webdriver/BiDi/BrowsingContext/NavigateCommand.cs
index 1ca3c3b19a598..87a36d5490ab7 100644
--- a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/NavigateCommand.cs
+++ b/dotnet/src/webdriver/BiDi/BrowsingContext/NavigateCommand.cs
@@ -19,14 +19,14 @@
using OpenQA.Selenium.BiDi.Communication;
-namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;
+namespace OpenQA.Selenium.BiDi.BrowsingContext;
-internal class NavigateCommand(NavigateCommandParameters @params)
+internal sealed class NavigateCommand(NavigateCommandParameters @params)
: Command(@params, "browsingContext.navigate");
-internal record NavigateCommandParameters(BrowsingContext Context, string Url, ReadinessState? Wait) : CommandParameters;
+internal sealed record NavigateCommandParameters(BrowsingContext Context, string Url, ReadinessState? Wait) : CommandParameters;
-public record NavigateOptions : CommandOptions
+public sealed class NavigateOptions : CommandOptions
{
public ReadinessState? Wait { get; set; }
}
@@ -38,4 +38,4 @@ public enum ReadinessState
Complete
}
-public record NavigateResult(Navigation Navigation, string Url) : EmptyResult;
+public sealed record NavigateResult(Navigation? Navigation, string Url) : EmptyResult;
diff --git a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/Navigation.cs b/dotnet/src/webdriver/BiDi/BrowsingContext/Navigation.cs
similarity index 90%
rename from dotnet/src/webdriver/BiDi/Modules/BrowsingContext/Navigation.cs
rename to dotnet/src/webdriver/BiDi/BrowsingContext/Navigation.cs
index 04784f995ea36..c763d7cc4a482 100644
--- a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/Navigation.cs
+++ b/dotnet/src/webdriver/BiDi/BrowsingContext/Navigation.cs
@@ -17,6 +17,6 @@
// under the License.
//
-namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;
+namespace OpenQA.Selenium.BiDi.BrowsingContext;
-public record Navigation(string Id);
+public sealed record Navigation(string Id);
diff --git a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/NavigationInfo.cs b/dotnet/src/webdriver/BiDi/BrowsingContext/NavigationInfo.cs
similarity index 83%
rename from dotnet/src/webdriver/BiDi/Modules/BrowsingContext/NavigationInfo.cs
rename to dotnet/src/webdriver/BiDi/BrowsingContext/NavigationInfo.cs
index 544618e1f4abe..91d6a589e7370 100644
--- a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/NavigationInfo.cs
+++ b/dotnet/src/webdriver/BiDi/BrowsingContext/NavigationInfo.cs
@@ -19,7 +19,7 @@
using System;
-namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;
+namespace OpenQA.Selenium.BiDi.BrowsingContext;
-public record NavigationInfo(BiDi BiDi, BrowsingContext Context, Navigation Navigation, DateTimeOffset Timestamp, string Url)
+public sealed record NavigationInfo(BiDi BiDi, BrowsingContext Context, Navigation? Navigation, DateTimeOffset Timestamp, string Url)
: BrowsingContextEventArgs(BiDi, Context);
diff --git a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/PrintCommand.cs b/dotnet/src/webdriver/BiDi/BrowsingContext/PrintCommand.cs
similarity index 86%
rename from dotnet/src/webdriver/BiDi/Modules/BrowsingContext/PrintCommand.cs
rename to dotnet/src/webdriver/BiDi/BrowsingContext/PrintCommand.cs
index 0e68022eb3f6a..ae689de7737e6 100644
--- a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/PrintCommand.cs
+++ b/dotnet/src/webdriver/BiDi/BrowsingContext/PrintCommand.cs
@@ -21,14 +21,14 @@
using System;
using System.Collections.Generic;
-namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;
+namespace OpenQA.Selenium.BiDi.BrowsingContext;
-internal class PrintCommand(PrintCommandParameters @params)
+internal sealed class PrintCommand(PrintCommandParameters @params)
: Command(@params, "browsingContext.print");
-internal record PrintCommandParameters(BrowsingContext Context, bool? Background, PrintMargin? Margin, PrintOrientation? Orientation, PrintPage? Page, IEnumerable? PageRanges, double? Scale, bool? ShrinkToFit) : CommandParameters;
+internal sealed record PrintCommandParameters(BrowsingContext Context, bool? Background, PrintMargin? Margin, PrintOrientation? Orientation, PrintPage? Page, IEnumerable? PageRanges, double? Scale, bool? ShrinkToFit) : CommandParameters;
-public record PrintOptions : CommandOptions
+public sealed class PrintOptions : CommandOptions
{
public bool? Background { get; set; }
@@ -112,7 +112,7 @@ public static implicit operator PrintPageRange(Range range)
#endif
}
-public record PrintResult(string Data) : EmptyResult
+public sealed record PrintResult(string Data) : EmptyResult
{
public byte[] ToByteArray() => Convert.FromBase64String(Data);
}
diff --git a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/ReloadCommand.cs b/dotnet/src/webdriver/BiDi/BrowsingContext/ReloadCommand.cs
similarity index 78%
rename from dotnet/src/webdriver/BiDi/Modules/BrowsingContext/ReloadCommand.cs
rename to dotnet/src/webdriver/BiDi/BrowsingContext/ReloadCommand.cs
index bea343a5e9bd1..7532d91359309 100644
--- a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/ReloadCommand.cs
+++ b/dotnet/src/webdriver/BiDi/BrowsingContext/ReloadCommand.cs
@@ -19,14 +19,14 @@
using OpenQA.Selenium.BiDi.Communication;
-namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;
+namespace OpenQA.Selenium.BiDi.BrowsingContext;
-internal class ReloadCommand(ReloadCommandParameters @params)
+internal sealed class ReloadCommand(ReloadCommandParameters @params)
: Command(@params, "browsingContext.reload");
-internal record ReloadCommandParameters(BrowsingContext Context, bool? IgnoreCache, ReadinessState? Wait) : CommandParameters;
+internal sealed record ReloadCommandParameters(BrowsingContext Context, bool? IgnoreCache, ReadinessState? Wait) : CommandParameters;
-public record ReloadOptions : CommandOptions
+public sealed class ReloadOptions : CommandOptions
{
public bool? IgnoreCache { get; set; }
diff --git a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/SetViewportCommand.cs b/dotnet/src/webdriver/BiDi/BrowsingContext/SetViewportCommand.cs
similarity index 78%
rename from dotnet/src/webdriver/BiDi/Modules/BrowsingContext/SetViewportCommand.cs
rename to dotnet/src/webdriver/BiDi/BrowsingContext/SetViewportCommand.cs
index 0b3437b29d5a7..bbf274481c040 100644
--- a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/SetViewportCommand.cs
+++ b/dotnet/src/webdriver/BiDi/BrowsingContext/SetViewportCommand.cs
@@ -19,14 +19,14 @@
using OpenQA.Selenium.BiDi.Communication;
-namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;
+namespace OpenQA.Selenium.BiDi.BrowsingContext;
-internal class SetViewportCommand(SetViewportCommandParameters @params)
+internal sealed class SetViewportCommand(SetViewportCommandParameters @params)
: Command(@params, "browsingContext.setViewport");
-internal record SetViewportCommandParameters(BrowsingContext Context, Viewport? Viewport, double? DevicePixelRatio) : CommandParameters;
+internal sealed record SetViewportCommandParameters(BrowsingContext Context, Viewport? Viewport, double? DevicePixelRatio) : CommandParameters;
-public record SetViewportOptions : CommandOptions
+public sealed class SetViewportOptions : CommandOptions
{
public Viewport? Viewport { get; set; }
diff --git a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/TraverseHistoryCommand.cs b/dotnet/src/webdriver/BiDi/BrowsingContext/TraverseHistoryCommand.cs
similarity index 74%
rename from dotnet/src/webdriver/BiDi/Modules/BrowsingContext/TraverseHistoryCommand.cs
rename to dotnet/src/webdriver/BiDi/BrowsingContext/TraverseHistoryCommand.cs
index ed166ad0beae4..410798bd6f726 100644
--- a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/TraverseHistoryCommand.cs
+++ b/dotnet/src/webdriver/BiDi/BrowsingContext/TraverseHistoryCommand.cs
@@ -19,13 +19,13 @@
using OpenQA.Selenium.BiDi.Communication;
-namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;
+namespace OpenQA.Selenium.BiDi.BrowsingContext;
-internal class TraverseHistoryCommand(TraverseHistoryCommandParameters @params)
+internal sealed class TraverseHistoryCommand(TraverseHistoryCommandParameters @params)
: Command(@params, "browsingContext.traverseHistory");
-internal record TraverseHistoryCommandParameters(BrowsingContext Context, long Delta) : CommandParameters;
+internal sealed record TraverseHistoryCommandParameters(BrowsingContext Context, long Delta) : CommandParameters;
-public record TraverseHistoryOptions : CommandOptions;
+public sealed class TraverseHistoryOptions : CommandOptions;
-public record TraverseHistoryResult : EmptyResult;
+public sealed record TraverseHistoryResult : EmptyResult;
diff --git a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/UserPromptClosedEventArgs.cs b/dotnet/src/webdriver/BiDi/BrowsingContext/UserPromptClosedEventArgs.cs
similarity index 87%
rename from dotnet/src/webdriver/BiDi/Modules/BrowsingContext/UserPromptClosedEventArgs.cs
rename to dotnet/src/webdriver/BiDi/BrowsingContext/UserPromptClosedEventArgs.cs
index cff09c3113b04..75d1395b69b05 100644
--- a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/UserPromptClosedEventArgs.cs
+++ b/dotnet/src/webdriver/BiDi/BrowsingContext/UserPromptClosedEventArgs.cs
@@ -19,9 +19,9 @@
using System.Text.Json.Serialization;
-namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;
+namespace OpenQA.Selenium.BiDi.BrowsingContext;
-public record UserPromptClosedEventArgs(BiDi BiDi, BrowsingContext Context, bool Accepted)
+public sealed record UserPromptClosedEventArgs(BiDi BiDi, BrowsingContext Context, bool Accepted)
: BrowsingContextEventArgs(BiDi, Context)
{
[JsonInclude]
diff --git a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/UserPromptOpenedEventArgs.cs b/dotnet/src/webdriver/BiDi/BrowsingContext/UserPromptOpenedEventArgs.cs
similarity index 84%
rename from dotnet/src/webdriver/BiDi/Modules/BrowsingContext/UserPromptOpenedEventArgs.cs
rename to dotnet/src/webdriver/BiDi/BrowsingContext/UserPromptOpenedEventArgs.cs
index 2a748c34a3c9c..6af71b761fde9 100644
--- a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/UserPromptOpenedEventArgs.cs
+++ b/dotnet/src/webdriver/BiDi/BrowsingContext/UserPromptOpenedEventArgs.cs
@@ -19,9 +19,9 @@
using System.Text.Json.Serialization;
-namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;
+namespace OpenQA.Selenium.BiDi.BrowsingContext;
-public record UserPromptOpenedEventArgs(BiDi BiDi, BrowsingContext Context, Session.UserPromptHandlerType Handler, UserPromptType Type, string Message)
+public sealed record UserPromptOpenedEventArgs(BiDi BiDi, BrowsingContext Context, Session.UserPromptHandlerType Handler, UserPromptType Type, string Message)
: BrowsingContextEventArgs(BiDi, Context)
{
[JsonInclude]
diff --git a/dotnet/src/webdriver/BiDi/Communication/Broker.cs b/dotnet/src/webdriver/BiDi/Communication/Broker.cs
index ec7cf5b5bd775..db926e3b7228e 100644
--- a/dotnet/src/webdriver/BiDi/Communication/Broker.cs
+++ b/dotnet/src/webdriver/BiDi/Communication/Broker.cs
@@ -34,7 +34,7 @@ namespace OpenQA.Selenium.BiDi.Communication;
public sealed class Broker : IAsyncDisposable
{
- private readonly ILogger _logger = Log.GetLogger();
+ private readonly ILogger _logger = Internal.Logging.Log.GetLogger();
private readonly BiDi _bidi;
private readonly ITransport _transport;
@@ -273,7 +273,7 @@ public async Task SubscribeAsync(string eventName, Fun
}
}
- public async Task UnsubscribeAsync(Modules.Session.Subscription subscription, EventHandler eventHandler)
+ public async Task UnsubscribeAsync(Session.Subscription subscription, EventHandler eventHandler)
{
var eventHandlers = _eventHandlers[eventHandler.EventName];
@@ -378,30 +378,49 @@ private void ProcessReceivedMessage(byte[]? data)
case "success":
if (id is null) throw new JsonException("The remote end responded with 'success' message type, but missed required 'id' property.");
- var successCommand = _pendingCommands[id.Value];
- var messageSuccess = JsonSerializer.Deserialize(ref resultReader, successCommand.ResultType, _jsonSerializerContext)!;
- successCommand.TaskCompletionSource.SetResult((EmptyResult)messageSuccess);
- _pendingCommands.TryRemove(id.Value, out _);
+ if (_pendingCommands.TryGetValue(id.Value, out var successCommand))
+ {
+ var messageSuccess = JsonSerializer.Deserialize(ref resultReader, successCommand.ResultType, _jsonSerializerContext)!;
+ successCommand.TaskCompletionSource.SetResult((EmptyResult)messageSuccess);
+ _pendingCommands.TryRemove(id.Value, out _);
+ }
+ else
+ {
+ throw new BiDiException($"The remote end responded with 'success' message type, but no pending command with id {id} was found.");
+ }
+
break;
case "event":
if (method is null) throw new JsonException("The remote end responded with 'event' message type, but missed required 'method' property.");
- var eventType = _eventTypesMap[method];
+ if (_eventTypesMap.TryGetValue(method, out var eventType))
+ {
+ var eventArgs = (EventArgs)JsonSerializer.Deserialize(ref paramsReader, eventType, _jsonSerializerContext)!;
- var eventArgs = (EventArgs)JsonSerializer.Deserialize(ref paramsReader, eventType, _jsonSerializerContext)!;
+ var messageEvent = new MessageEvent(method, eventArgs);
+ _pendingEvents.Add(messageEvent);
+ }
+ else
+ {
+ throw new BiDiException($"The remote end responded with 'event' message type, but no event type mapping for method '{method}' was found.");
+ }
- var messageEvent = new MessageEvent(method, eventArgs);
- _pendingEvents.Add(messageEvent);
break;
case "error":
if (id is null) throw new JsonException("The remote end responded with 'error' message type, but missed required 'id' property.");
- var messageError = new MessageError(id.Value) { Error = error, Message = message };
- var errorCommand = _pendingCommands[messageError.Id];
- errorCommand.TaskCompletionSource.SetException(new BiDiException($"{messageError.Error}: {messageError.Message}"));
- _pendingCommands.TryRemove(messageError.Id, out _);
+ if (_pendingCommands.TryGetValue(id.Value, out var errorCommand))
+ {
+ errorCommand.TaskCompletionSource.SetException(new BiDiException($"{error}: {message}"));
+ _pendingCommands.TryRemove(id.Value, out _);
+ }
+ else
+ {
+ throw new BiDiException($"The remote end responded with 'error' message type, but no pending command with id {id} was found.");
+ }
+
break;
}
}
diff --git a/dotnet/src/webdriver/BiDi/Communication/CommandOptions.cs b/dotnet/src/webdriver/BiDi/Communication/CommandOptions.cs
index 5d414b5cd25ae..a68281a03800d 100644
--- a/dotnet/src/webdriver/BiDi/Communication/CommandOptions.cs
+++ b/dotnet/src/webdriver/BiDi/Communication/CommandOptions.cs
@@ -21,7 +21,7 @@
namespace OpenQA.Selenium.BiDi.Communication;
-public record CommandOptions
+public abstract class CommandOptions
{
public TimeSpan? Timeout { get; set; }
}
diff --git a/dotnet/src/webdriver/BiDi/Communication/EventHandler.cs b/dotnet/src/webdriver/BiDi/Communication/EventHandler.cs
index fd67f167dbb87..4f291fcb8da08 100644
--- a/dotnet/src/webdriver/BiDi/Communication/EventHandler.cs
+++ b/dotnet/src/webdriver/BiDi/Communication/EventHandler.cs
@@ -17,23 +17,22 @@
// under the License.
//
-using OpenQA.Selenium.BiDi.Modules.BrowsingContext;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace OpenQA.Selenium.BiDi.Communication;
-public abstract class EventHandler(string eventName, Type eventArgsType, IEnumerable? contexts = null)
+public abstract class EventHandler(string eventName, Type eventArgsType, IEnumerable? contexts = null)
{
public string EventName { get; } = eventName;
public Type EventArgsType { get; set; } = eventArgsType;
- public IEnumerable? Contexts { get; } = contexts;
+ public IEnumerable? Contexts { get; } = contexts;
public abstract ValueTask InvokeAsync(object args);
}
-internal class AsyncEventHandler(string eventName, Func func, IEnumerable? contexts = null)
+internal class AsyncEventHandler(string eventName, Func func, IEnumerable? contexts = null)
: EventHandler(eventName, typeof(TEventArgs), contexts) where TEventArgs : EventArgs
{
private readonly Func _func = func;
@@ -44,7 +43,7 @@ public override async ValueTask InvokeAsync(object args)
}
}
-internal class SyncEventHandler(string eventName, Action action, IEnumerable? contexts = null)
+internal class SyncEventHandler(string eventName, Action action, IEnumerable? contexts = null)
: EventHandler(eventName, typeof(TEventArgs), contexts) where TEventArgs : EventArgs
{
private readonly Action _action = action;
diff --git a/dotnet/src/webdriver/BiDi/Communication/Json/BiDiJsonSerializerContext.cs b/dotnet/src/webdriver/BiDi/Communication/Json/BiDiJsonSerializerContext.cs
index dfee51b37a522..5b2a0b803ff7a 100644
--- a/dotnet/src/webdriver/BiDi/Communication/Json/BiDiJsonSerializerContext.cs
+++ b/dotnet/src/webdriver/BiDi/Communication/Json/BiDiJsonSerializerContext.cs
@@ -23,145 +23,146 @@
namespace OpenQA.Selenium.BiDi.Communication.Json;
#region https://github.com/dotnet/runtime/issues/72604
-[JsonSerializable(typeof(Modules.Script.EvaluateResultSuccess))]
-[JsonSerializable(typeof(Modules.Script.EvaluateResultException))]
-
-[JsonSerializable(typeof(Modules.Script.NumberRemoteValue))]
-[JsonSerializable(typeof(Modules.Script.BooleanRemoteValue))]
-[JsonSerializable(typeof(Modules.Script.BigIntRemoteValue))]
-[JsonSerializable(typeof(Modules.Script.StringRemoteValue))]
-[JsonSerializable(typeof(Modules.Script.NullRemoteValue))]
-[JsonSerializable(typeof(Modules.Script.UndefinedRemoteValue))]
-[JsonSerializable(typeof(Modules.Script.SymbolRemoteValue))]
-[JsonSerializable(typeof(Modules.Script.ArrayRemoteValue))]
-[JsonSerializable(typeof(Modules.Script.ObjectRemoteValue))]
-[JsonSerializable(typeof(Modules.Script.FunctionRemoteValue))]
-[JsonSerializable(typeof(Modules.Script.RegExpRemoteValue))]
-[JsonSerializable(typeof(Modules.Script.DateRemoteValue))]
-[JsonSerializable(typeof(Modules.Script.MapRemoteValue))]
-[JsonSerializable(typeof(Modules.Script.SetRemoteValue))]
-[JsonSerializable(typeof(Modules.Script.WeakMapRemoteValue))]
-[JsonSerializable(typeof(Modules.Script.WeakSetRemoteValue))]
-[JsonSerializable(typeof(Modules.Script.GeneratorRemoteValue))]
-[JsonSerializable(typeof(Modules.Script.ErrorRemoteValue))]
-[JsonSerializable(typeof(Modules.Script.ProxyRemoteValue))]
-[JsonSerializable(typeof(Modules.Script.PromiseRemoteValue))]
-[JsonSerializable(typeof(Modules.Script.TypedArrayRemoteValue))]
-[JsonSerializable(typeof(Modules.Script.ArrayBufferRemoteValue))]
-[JsonSerializable(typeof(Modules.Script.NodeListRemoteValue))]
-[JsonSerializable(typeof(Modules.Script.HtmlCollectionRemoteValue))]
-[JsonSerializable(typeof(Modules.Script.NodeRemoteValue))]
-[JsonSerializable(typeof(Modules.Script.WindowProxyRemoteValue))]
-
-[JsonSerializable(typeof(Modules.Script.WindowRealmInfo))]
-[JsonSerializable(typeof(Modules.Script.DedicatedWorkerRealmInfo))]
-[JsonSerializable(typeof(Modules.Script.SharedWorkerRealmInfo))]
-[JsonSerializable(typeof(Modules.Script.ServiceWorkerRealmInfo))]
-[JsonSerializable(typeof(Modules.Script.WorkerRealmInfo))]
-[JsonSerializable(typeof(Modules.Script.PaintWorkletRealmInfo))]
-[JsonSerializable(typeof(Modules.Script.AudioWorkletRealmInfo))]
-[JsonSerializable(typeof(Modules.Script.WorkletRealmInfo))]
-
-[JsonSerializable(typeof(Modules.Log.GenericLogEntry))]
-[JsonSerializable(typeof(Modules.Log.ConsoleLogEntry))]
-[JsonSerializable(typeof(Modules.Log.JavascriptLogEntry))]
+[JsonSerializable(typeof(Script.EvaluateResultSuccess))]
+[JsonSerializable(typeof(Script.EvaluateResultException))]
+
+[JsonSerializable(typeof(Script.NumberRemoteValue))]
+[JsonSerializable(typeof(Script.BooleanRemoteValue))]
+[JsonSerializable(typeof(Script.BigIntRemoteValue))]
+[JsonSerializable(typeof(Script.StringRemoteValue))]
+[JsonSerializable(typeof(Script.NullRemoteValue))]
+[JsonSerializable(typeof(Script.UndefinedRemoteValue))]
+[JsonSerializable(typeof(Script.SymbolRemoteValue))]
+[JsonSerializable(typeof(Script.ArrayRemoteValue))]
+[JsonSerializable(typeof(Script.ObjectRemoteValue))]
+[JsonSerializable(typeof(Script.FunctionRemoteValue))]
+[JsonSerializable(typeof(Script.RegExpRemoteValue))]
+[JsonSerializable(typeof(Script.DateRemoteValue))]
+[JsonSerializable(typeof(Script.MapRemoteValue))]
+[JsonSerializable(typeof(Script.SetRemoteValue))]
+[JsonSerializable(typeof(Script.WeakMapRemoteValue))]
+[JsonSerializable(typeof(Script.WeakSetRemoteValue))]
+[JsonSerializable(typeof(Script.GeneratorRemoteValue))]
+[JsonSerializable(typeof(Script.ErrorRemoteValue))]
+[JsonSerializable(typeof(Script.ProxyRemoteValue))]
+[JsonSerializable(typeof(Script.PromiseRemoteValue))]
+[JsonSerializable(typeof(Script.TypedArrayRemoteValue))]
+[JsonSerializable(typeof(Script.ArrayBufferRemoteValue))]
+[JsonSerializable(typeof(Script.NodeListRemoteValue))]
+[JsonSerializable(typeof(Script.HtmlCollectionRemoteValue))]
+[JsonSerializable(typeof(Script.NodeRemoteValue))]
+[JsonSerializable(typeof(Script.WindowProxyRemoteValue))]
+
+[JsonSerializable(typeof(Script.WindowRealmInfo))]
+[JsonSerializable(typeof(Script.DedicatedWorkerRealmInfo))]
+[JsonSerializable(typeof(Script.SharedWorkerRealmInfo))]
+[JsonSerializable(typeof(Script.ServiceWorkerRealmInfo))]
+[JsonSerializable(typeof(Script.WorkerRealmInfo))]
+[JsonSerializable(typeof(Script.PaintWorkletRealmInfo))]
+[JsonSerializable(typeof(Script.AudioWorkletRealmInfo))]
+[JsonSerializable(typeof(Script.WorkletRealmInfo))]
+
+[JsonSerializable(typeof(Log.GenericLogEntry))]
+[JsonSerializable(typeof(Log.ConsoleLogEntry))]
+[JsonSerializable(typeof(Log.JavascriptLogEntry))]
#endregion
[JsonSerializable(typeof(Command))]
[JsonSerializable(typeof(EmptyResult))]
-[JsonSerializable(typeof(Modules.Session.StatusCommand))]
-[JsonSerializable(typeof(Modules.Session.StatusResult))]
-[JsonSerializable(typeof(Modules.Session.NewCommand))]
-[JsonSerializable(typeof(Modules.Session.NewResult))]
-[JsonSerializable(typeof(Modules.Session.EndCommand))]
-[JsonSerializable(typeof(Modules.Session.SubscribeCommand))]
-[JsonSerializable(typeof(Modules.Session.SubscribeResult))]
-[JsonSerializable(typeof(Modules.Session.UnsubscribeByIdCommand))]
-[JsonSerializable(typeof(Modules.Session.UnsubscribeByAttributesCommand))]
-
-[JsonSerializable(typeof(Modules.Browser.CloseCommand), TypeInfoPropertyName = "Browser_CloseCommand")]
-[JsonSerializable(typeof(Modules.Browser.CreateUserContextCommand))]
-[JsonSerializable(typeof(Modules.Browser.GetUserContextsCommand))]
-[JsonSerializable(typeof(Modules.Browser.GetUserContextsResult))]
-[JsonSerializable(typeof(Modules.Browser.RemoveUserContextCommand))]
-[JsonSerializable(typeof(Modules.Browser.GetClientWindowsCommand))]
-[JsonSerializable(typeof(Modules.Browser.GetClientWindowsResult))]
-[JsonSerializable(typeof(Modules.Browser.UserContextInfo))]
-[JsonSerializable(typeof(IReadOnlyList))]
-[JsonSerializable(typeof(IReadOnlyList))]
-
-
-[JsonSerializable(typeof(Modules.BrowsingContext.ActivateCommand))]
-[JsonSerializable(typeof(Modules.BrowsingContext.CaptureScreenshotCommand))]
-[JsonSerializable(typeof(Modules.BrowsingContext.CaptureScreenshotResult))]
-[JsonSerializable(typeof(Modules.BrowsingContext.CloseCommand), TypeInfoPropertyName = "BrowsingContext_CloseCommand")]
-[JsonSerializable(typeof(Modules.BrowsingContext.CreateCommand))]
-[JsonSerializable(typeof(Modules.BrowsingContext.CreateResult))]
-[JsonSerializable(typeof(Modules.BrowsingContext.GetTreeCommand))]
-[JsonSerializable(typeof(Modules.BrowsingContext.GetTreeResult))]
-[JsonSerializable(typeof(Modules.BrowsingContext.HandleUserPromptCommand))]
-[JsonSerializable(typeof(Modules.BrowsingContext.LocateNodesCommand))]
-[JsonSerializable(typeof(Modules.BrowsingContext.LocateNodesResult))]
-[JsonSerializable(typeof(Modules.BrowsingContext.NavigateCommand))]
-[JsonSerializable(typeof(Modules.BrowsingContext.NavigateResult))]
-[JsonSerializable(typeof(Modules.BrowsingContext.PrintCommand))]
-[JsonSerializable(typeof(Modules.BrowsingContext.PrintResult))]
-[JsonSerializable(typeof(Modules.BrowsingContext.ReloadCommand))]
-[JsonSerializable(typeof(Modules.BrowsingContext.SetViewportCommand))]
-[JsonSerializable(typeof(Modules.BrowsingContext.TraverseHistoryCommand))]
-[JsonSerializable(typeof(Modules.BrowsingContext.TraverseHistoryResult))]
-[JsonSerializable(typeof(Modules.BrowsingContext.BrowsingContextInfo))]
-[JsonSerializable(typeof(Modules.BrowsingContext.NavigationInfo))]
-
-[JsonSerializable(typeof(Modules.BrowsingContext.UserPromptOpenedEventArgs))]
-[JsonSerializable(typeof(Modules.BrowsingContext.UserPromptClosedEventArgs))]
-
-[JsonSerializable(typeof(Modules.Network.AddInterceptCommand))]
-[JsonSerializable(typeof(Modules.Network.AddInterceptResult))]
-[JsonSerializable(typeof(Modules.Network.ContinueRequestCommand))]
-[JsonSerializable(typeof(Modules.Network.ContinueResponseCommand))]
-[JsonSerializable(typeof(Modules.Network.ContinueWithAuthCommand))]
-[JsonSerializable(typeof(Modules.Network.FailRequestCommand))]
-[JsonSerializable(typeof(Modules.Network.ProvideResponseCommand))]
-[JsonSerializable(typeof(Modules.Network.RemoveInterceptCommand))]
-[JsonSerializable(typeof(Modules.Network.SetCacheBehaviorCommand))]
-
-[JsonSerializable(typeof(Modules.Network.BeforeRequestSentEventArgs))]
-[JsonSerializable(typeof(Modules.Network.ResponseStartedEventArgs))]
-[JsonSerializable(typeof(Modules.Network.ResponseCompletedEventArgs))]
-[JsonSerializable(typeof(Modules.Network.FetchErrorEventArgs))]
-[JsonSerializable(typeof(Modules.Network.AuthRequiredEventArgs))]
-
-[JsonSerializable(typeof(Modules.Script.AddPreloadScriptCommand))]
-[JsonSerializable(typeof(Modules.Script.AddPreloadScriptResult))]
-[JsonSerializable(typeof(Modules.Script.DisownCommand))]
-[JsonSerializable(typeof(Modules.Script.CallFunctionCommand))]
-[JsonSerializable(typeof(Modules.Script.EvaluateCommand))]
-[JsonSerializable(typeof(Modules.Script.EvaluateResult))]
-[JsonSerializable(typeof(Modules.Script.GetRealmsCommand))]
-[JsonSerializable(typeof(Modules.Script.GetRealmsResult))]
-[JsonSerializable(typeof(Modules.Script.RemovePreloadScriptCommand))]
-
-[JsonSerializable(typeof(Modules.Script.MessageEventArgs))]
-[JsonSerializable(typeof(Modules.Script.RealmDestroyedEventArgs))]
-[JsonSerializable(typeof(IReadOnlyList))]
-
-[JsonSerializable(typeof(Modules.Log.LogEntry))]
-
-[JsonSerializable(typeof(Modules.Storage.GetCookiesCommand))]
-[JsonSerializable(typeof(Modules.Storage.GetCookiesResult))]
-[JsonSerializable(typeof(Modules.Storage.SetCookieCommand))]
-[JsonSerializable(typeof(Modules.Storage.SetCookieResult))]
-[JsonSerializable(typeof(Modules.Storage.DeleteCookiesCommand))]
-[JsonSerializable(typeof(Modules.Storage.DeleteCookiesResult))]
-
-[JsonSerializable(typeof(Modules.Input.PerformActionsCommand))]
-[JsonSerializable(typeof(Modules.Input.ReleaseActionsCommand))]
-[JsonSerializable(typeof(Modules.Input.SetFilesCommand))]
-[JsonSerializable(typeof(IEnumerable))]
-[JsonSerializable(typeof(IEnumerable))]
-[JsonSerializable(typeof(IEnumerable))]
-[JsonSerializable(typeof(IEnumerable))]
+[JsonSerializable(typeof(Session.StatusCommand))]
+[JsonSerializable(typeof(Session.StatusResult))]
+[JsonSerializable(typeof(Session.NewCommand))]
+[JsonSerializable(typeof(Session.NewResult))]
+[JsonSerializable(typeof(Session.EndCommand))]
+[JsonSerializable(typeof(Session.SubscribeCommand))]
+[JsonSerializable(typeof(Session.SubscribeResult))]
+[JsonSerializable(typeof(Session.UnsubscribeByIdCommand))]
+[JsonSerializable(typeof(Session.UnsubscribeByAttributesCommand))]
+
+[JsonSerializable(typeof(Browser.CloseCommand), TypeInfoPropertyName = "Browser_CloseCommand")]
+[JsonSerializable(typeof(Browser.CreateUserContextCommand))]
+[JsonSerializable(typeof(Browser.GetUserContextsCommand))]
+[JsonSerializable(typeof(Browser.GetUserContextsResult))]
+[JsonSerializable(typeof(Browser.RemoveUserContextCommand))]
+[JsonSerializable(typeof(Browser.GetClientWindowsCommand))]
+[JsonSerializable(typeof(Browser.GetClientWindowsResult))]
+[JsonSerializable(typeof(Browser.UserContextInfo))]
+[JsonSerializable(typeof(IReadOnlyList))]
+[JsonSerializable(typeof(IReadOnlyList))]
+
+
+[JsonSerializable(typeof(BrowsingContext.ActivateCommand))]
+[JsonSerializable(typeof(BrowsingContext.CaptureScreenshotCommand))]
+[JsonSerializable(typeof(BrowsingContext.CaptureScreenshotResult))]
+[JsonSerializable(typeof(BrowsingContext.CloseCommand), TypeInfoPropertyName = "BrowsingContext_CloseCommand")]
+[JsonSerializable(typeof(BrowsingContext.CreateCommand))]
+[JsonSerializable(typeof(BrowsingContext.CreateResult))]
+[JsonSerializable(typeof(BrowsingContext.GetTreeCommand))]
+[JsonSerializable(typeof(BrowsingContext.GetTreeResult))]
+[JsonSerializable(typeof(BrowsingContext.HandleUserPromptCommand))]
+[JsonSerializable(typeof(BrowsingContext.LocateNodesCommand))]
+[JsonSerializable(typeof(BrowsingContext.LocateNodesResult))]
+[JsonSerializable(typeof(BrowsingContext.NavigateCommand))]
+[JsonSerializable(typeof(BrowsingContext.NavigateResult))]
+[JsonSerializable(typeof(BrowsingContext.PrintCommand))]
+[JsonSerializable(typeof(BrowsingContext.PrintResult))]
+[JsonSerializable(typeof(BrowsingContext.ReloadCommand))]
+[JsonSerializable(typeof(BrowsingContext.SetViewportCommand))]
+[JsonSerializable(typeof(BrowsingContext.TraverseHistoryCommand))]
+[JsonSerializable(typeof(BrowsingContext.TraverseHistoryResult))]
+
+[JsonSerializable(typeof(BrowsingContext.BrowsingContextInfo))]
+[JsonSerializable(typeof(BrowsingContext.HistoryUpdatedEventArgs))]
+[JsonSerializable(typeof(BrowsingContext.NavigationInfo))]
+[JsonSerializable(typeof(BrowsingContext.UserPromptOpenedEventArgs))]
+[JsonSerializable(typeof(BrowsingContext.UserPromptClosedEventArgs))]
+
+[JsonSerializable(typeof(Network.AddInterceptCommand))]
+[JsonSerializable(typeof(Network.AddInterceptResult))]
+[JsonSerializable(typeof(Network.ContinueRequestCommand))]
+[JsonSerializable(typeof(Network.ContinueResponseCommand))]
+[JsonSerializable(typeof(Network.ContinueWithAuthCommand))]
+[JsonSerializable(typeof(Network.FailRequestCommand))]
+[JsonSerializable(typeof(Network.ProvideResponseCommand))]
+[JsonSerializable(typeof(Network.RemoveInterceptCommand))]
+[JsonSerializable(typeof(Network.SetCacheBehaviorCommand))]
+
+[JsonSerializable(typeof(Network.BeforeRequestSentEventArgs))]
+[JsonSerializable(typeof(Network.ResponseStartedEventArgs))]
+[JsonSerializable(typeof(Network.ResponseCompletedEventArgs))]
+[JsonSerializable(typeof(Network.FetchErrorEventArgs))]
+[JsonSerializable(typeof(Network.AuthRequiredEventArgs))]
+
+[JsonSerializable(typeof(Script.AddPreloadScriptCommand))]
+[JsonSerializable(typeof(Script.AddPreloadScriptResult))]
+[JsonSerializable(typeof(Script.DisownCommand))]
+[JsonSerializable(typeof(Script.CallFunctionCommand))]
+[JsonSerializable(typeof(Script.EvaluateCommand))]
+[JsonSerializable(typeof(Script.EvaluateResult))]
+[JsonSerializable(typeof(Script.GetRealmsCommand))]
+[JsonSerializable(typeof(Script.GetRealmsResult))]
+[JsonSerializable(typeof(Script.RemovePreloadScriptCommand))]
+
+[JsonSerializable(typeof(Script.MessageEventArgs))]
+[JsonSerializable(typeof(Script.RealmDestroyedEventArgs))]
+[JsonSerializable(typeof(IReadOnlyList))]
+
+[JsonSerializable(typeof(Log.LogEntry))]
+
+[JsonSerializable(typeof(Storage.GetCookiesCommand))]
+[JsonSerializable(typeof(Storage.GetCookiesResult))]
+[JsonSerializable(typeof(Storage.SetCookieCommand))]
+[JsonSerializable(typeof(Storage.SetCookieResult))]
+[JsonSerializable(typeof(Storage.DeleteCookiesCommand))]
+[JsonSerializable(typeof(Storage.DeleteCookiesResult))]
+
+[JsonSerializable(typeof(Input.PerformActionsCommand))]
+[JsonSerializable(typeof(Input.ReleaseActionsCommand))]
+[JsonSerializable(typeof(Input.SetFilesCommand))]
+[JsonSerializable(typeof(IEnumerable))]
+[JsonSerializable(typeof(IEnumerable))]
+[JsonSerializable(typeof(IEnumerable))]
+[JsonSerializable(typeof(IEnumerable))]
internal partial class BiDiJsonSerializerContext : JsonSerializerContext;
diff --git a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/BrowserClientWindowConverter.cs b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/BrowserClientWindowConverter.cs
index d04eca3b6b328..5849c3bfe6cf4 100644
--- a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/BrowserClientWindowConverter.cs
+++ b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/BrowserClientWindowConverter.cs
@@ -17,7 +17,7 @@
// under the License.
//
-using OpenQA.Selenium.BiDi.Modules.Browser;
+using OpenQA.Selenium.BiDi.Browser;
using System;
using System.Text.Json;
using System.Text.Json.Serialization;
diff --git a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/BrowserUserContextConverter.cs b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/BrowserUserContextConverter.cs
index 71acc2b8db4d0..3d68e7f5cd150 100644
--- a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/BrowserUserContextConverter.cs
+++ b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/BrowserUserContextConverter.cs
@@ -17,7 +17,7 @@
// under the License.
//
-using OpenQA.Selenium.BiDi.Modules.Browser;
+using OpenQA.Selenium.BiDi.Browser;
using System;
using System.Text.Json;
using System.Text.Json.Serialization;
diff --git a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/BrowsingContextConverter.cs b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/BrowsingContextConverter.cs
index c7906e9804484..fc3b3aefd9b7d 100644
--- a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/BrowsingContextConverter.cs
+++ b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/BrowsingContextConverter.cs
@@ -17,14 +17,13 @@
// under the License.
//
-using OpenQA.Selenium.BiDi.Modules.BrowsingContext;
using System;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace OpenQA.Selenium.BiDi.Communication.Json.Converters;
-internal class BrowsingContextConverter : JsonConverter
+internal class BrowsingContextConverter : JsonConverter
{
private readonly BiDi _bidi;
@@ -33,14 +32,14 @@ public BrowsingContextConverter(BiDi bidi)
_bidi = bidi;
}
- public override BrowsingContext? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+ public override BrowsingContext.BrowsingContext? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var id = reader.GetString();
- return new BrowsingContext(_bidi, id!);
+ return new BrowsingContext.BrowsingContext(_bidi, id!);
}
- public override void Write(Utf8JsonWriter writer, BrowsingContext value, JsonSerializerOptions options)
+ public override void Write(Utf8JsonWriter writer, BrowsingContext.BrowsingContext value, JsonSerializerOptions options)
{
writer.WriteStringValue(value.Id);
}
diff --git a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/ChannelConverter.cs b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/ChannelConverter.cs
index 11f659a4ff739..43110782e8f40 100644
--- a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/ChannelConverter.cs
+++ b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/ChannelConverter.cs
@@ -17,7 +17,7 @@
// under the License.
//
-using OpenQA.Selenium.BiDi.Modules.Script;
+using OpenQA.Selenium.BiDi.Script;
using System;
using System.Text.Json;
using System.Text.Json.Serialization;
diff --git a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetClientWindowsResultConverter.cs b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetClientWindowsResultConverter.cs
index f3184aaa607da..a95315945e639 100644
--- a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetClientWindowsResultConverter.cs
+++ b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetClientWindowsResultConverter.cs
@@ -18,7 +18,7 @@
//
using OpenQA.Selenium.BiDi.Communication.Json.Internal;
-using OpenQA.Selenium.BiDi.Modules.Browser;
+using OpenQA.Selenium.BiDi.Browser;
using System;
using System.Collections.Generic;
using System.Text.Json;
diff --git a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetCookiesResultConverter.cs b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetCookiesResultConverter.cs
index eb5944eb1719c..62db12fe20ef1 100644
--- a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetCookiesResultConverter.cs
+++ b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetCookiesResultConverter.cs
@@ -18,7 +18,7 @@
//
using OpenQA.Selenium.BiDi.Communication.Json.Internal;
-using OpenQA.Selenium.BiDi.Modules.Storage;
+using OpenQA.Selenium.BiDi.Storage;
using System;
using System.Collections.Generic;
using System.Text.Json;
@@ -32,7 +32,7 @@ internal class GetCookiesResultConverter : JsonConverter
public override GetCookiesResult Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
using var doc = JsonDocument.ParseValue(ref reader);
- var cookies = doc.RootElement.GetProperty("cookies").Deserialize(options.GetTypeInfo>());
+ var cookies = doc.RootElement.GetProperty("cookies").Deserialize(options.GetTypeInfo>());
var partitionKey = doc.RootElement.GetProperty("partitionKey").Deserialize((JsonTypeInfo)options.GetTypeInfo(typeof(PartitionKey)));
return new GetCookiesResult(cookies!, partitionKey!);
diff --git a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetRealmsResultConverter.cs b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetRealmsResultConverter.cs
index 2759ba6ba6b7f..86f773bbd0e47 100644
--- a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetRealmsResultConverter.cs
+++ b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetRealmsResultConverter.cs
@@ -18,7 +18,7 @@
//
using OpenQA.Selenium.BiDi.Communication.Json.Internal;
-using OpenQA.Selenium.BiDi.Modules.Script;
+using OpenQA.Selenium.BiDi.Script;
using System;
using System.Collections.Generic;
using System.Text.Json;
diff --git a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetUserContextsResultConverter.cs b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetUserContextsResultConverter.cs
index 55b533e877518..b5d471c4fe4c8 100644
--- a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetUserContextsResultConverter.cs
+++ b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetUserContextsResultConverter.cs
@@ -18,7 +18,7 @@
//
using OpenQA.Selenium.BiDi.Communication.Json.Internal;
-using OpenQA.Selenium.BiDi.Modules.Browser;
+using OpenQA.Selenium.BiDi.Browser;
using System;
using System.Collections.Generic;
using System.Text.Json;
diff --git a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/InputSourceActionsConverter.cs b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/InputSourceActionsConverter.cs
index 478cdf423cb50..a73f141e086ee 100644
--- a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/InputSourceActionsConverter.cs
+++ b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/InputSourceActionsConverter.cs
@@ -18,7 +18,7 @@
//
using OpenQA.Selenium.BiDi.Communication.Json.Internal;
-using OpenQA.Selenium.BiDi.Modules.Input;
+using OpenQA.Selenium.BiDi.Input;
using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/LocateNodesResultConverter.cs b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/LocateNodesResultConverter.cs
index 36afde9ef7094..d60e77b86b3d1 100644
--- a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/LocateNodesResultConverter.cs
+++ b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/LocateNodesResultConverter.cs
@@ -18,8 +18,8 @@
//
using OpenQA.Selenium.BiDi.Communication.Json.Internal;
-using OpenQA.Selenium.BiDi.Modules.BrowsingContext;
-using OpenQA.Selenium.BiDi.Modules.Script;
+using OpenQA.Selenium.BiDi.BrowsingContext;
+using OpenQA.Selenium.BiDi.Script;
using System;
using System.Collections.Generic;
using System.Text.Json;
diff --git a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/HandleConverter.cs b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/HandleConverter.cs
index f57f4d4d73d3c..f2e9af7139840 100644
--- a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/HandleConverter.cs
+++ b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/HandleConverter.cs
@@ -17,7 +17,7 @@
// under the License.
//
-using OpenQA.Selenium.BiDi.Modules.Script;
+using OpenQA.Selenium.BiDi.Script;
using System;
using System.Text.Json;
using System.Text.Json.Serialization;
diff --git a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/InputOriginConverter.cs b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/InputOriginConverter.cs
index 9ff3a88973670..f47b25bb7ee37 100644
--- a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/InputOriginConverter.cs
+++ b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/InputOriginConverter.cs
@@ -17,7 +17,7 @@
// under the License.
//
-using OpenQA.Selenium.BiDi.Modules.Input;
+using OpenQA.Selenium.BiDi.Input;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json;
diff --git a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/InterceptConverter.cs b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/InterceptConverter.cs
index d182c00b390a4..d789065e8d458 100644
--- a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/InterceptConverter.cs
+++ b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/InterceptConverter.cs
@@ -17,7 +17,7 @@
// under the License.
//
-using OpenQA.Selenium.BiDi.Modules.Network;
+using OpenQA.Selenium.BiDi.Network;
using System;
using System.Text.Json;
using System.Text.Json.Serialization;
diff --git a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/InternalIdConverter.cs b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/InternalIdConverter.cs
index 412d4575b6cd4..ec65181f7c9bb 100644
--- a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/InternalIdConverter.cs
+++ b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/InternalIdConverter.cs
@@ -17,7 +17,7 @@
// under the License.
//
-using OpenQA.Selenium.BiDi.Modules.Script;
+using OpenQA.Selenium.BiDi.Script;
using System;
using System.Text.Json;
using System.Text.Json.Serialization;
diff --git a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/NavigationConverter.cs b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/NavigationConverter.cs
index 006671f6a0eba..ce9d27b9a2b63 100644
--- a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/NavigationConverter.cs
+++ b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/NavigationConverter.cs
@@ -17,7 +17,7 @@
// under the License.
//
-using OpenQA.Selenium.BiDi.Modules.BrowsingContext;
+using OpenQA.Selenium.BiDi.BrowsingContext;
using System;
using System.Text.Json;
using System.Text.Json.Serialization;
diff --git a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Polymorphic/EvaluateResultConverter.cs b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Polymorphic/EvaluateResultConverter.cs
index 81da2edda5a2b..25f94b42b4dc7 100644
--- a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Polymorphic/EvaluateResultConverter.cs
+++ b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Polymorphic/EvaluateResultConverter.cs
@@ -18,7 +18,7 @@
//
using OpenQA.Selenium.BiDi.Communication.Json.Internal;
-using OpenQA.Selenium.BiDi.Modules.Script;
+using OpenQA.Selenium.BiDi.Script;
using System;
using System.Text.Json;
using System.Text.Json.Serialization;
diff --git a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Polymorphic/LogEntryConverter.cs b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Polymorphic/LogEntryConverter.cs
index fc72b2024fedc..53f90772a3b0e 100644
--- a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Polymorphic/LogEntryConverter.cs
+++ b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Polymorphic/LogEntryConverter.cs
@@ -18,7 +18,7 @@
//
using OpenQA.Selenium.BiDi.Communication.Json.Internal;
-using OpenQA.Selenium.BiDi.Modules.Log;
+using OpenQA.Selenium.BiDi.Log;
using System;
using System.Text.Json;
using System.Text.Json.Serialization;
@@ -26,9 +26,9 @@
namespace OpenQA.Selenium.BiDi.Communication.Json.Converters.Polymorphic;
// https://github.com/dotnet/runtime/issues/72604
-internal class LogEntryConverter : JsonConverter
+internal class LogEntryConverter : JsonConverter
{
- public override Modules.Log.LogEntry? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+ public override Log.LogEntry? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return reader.GetDiscriminator("type") switch
{
@@ -38,7 +38,7 @@ internal class LogEntryConverter : JsonConverter
};
}
- public override void Write(Utf8JsonWriter writer, Modules.Log.LogEntry value, JsonSerializerOptions options)
+ public override void Write(Utf8JsonWriter writer, Log.LogEntry value, JsonSerializerOptions options)
{
throw new NotImplementedException();
}
diff --git a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Polymorphic/RealmInfoConverter.cs b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Polymorphic/RealmInfoConverter.cs
index 635e2eb79864c..288ffb496a3f8 100644
--- a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Polymorphic/RealmInfoConverter.cs
+++ b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Polymorphic/RealmInfoConverter.cs
@@ -18,7 +18,7 @@
//
using OpenQA.Selenium.BiDi.Communication.Json.Internal;
-using OpenQA.Selenium.BiDi.Modules.Script;
+using OpenQA.Selenium.BiDi.Script;
using System;
using System.Text.Json;
using System.Text.Json.Serialization;
diff --git a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Polymorphic/RemoteValueConverter.cs b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Polymorphic/RemoteValueConverter.cs
index 2daacdf987e4c..6879403266419 100644
--- a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Polymorphic/RemoteValueConverter.cs
+++ b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/Polymorphic/RemoteValueConverter.cs
@@ -18,7 +18,7 @@
//
using OpenQA.Selenium.BiDi.Communication.Json.Internal;
-using OpenQA.Selenium.BiDi.Modules.Script;
+using OpenQA.Selenium.BiDi.Script;
using System;
using System.Text.Json;
using System.Text.Json.Serialization;
diff --git a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/PreloadScriptConverter.cs b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/PreloadScriptConverter.cs
index 47632238b307c..e7fc7bc4be8ff 100644
--- a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/PreloadScriptConverter.cs
+++ b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/PreloadScriptConverter.cs
@@ -17,7 +17,7 @@
// under the License.
//
-using OpenQA.Selenium.BiDi.Modules.Script;
+using OpenQA.Selenium.BiDi.Script;
using System;
using System.Text.Json;
using System.Text.Json.Serialization;
diff --git a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/PrintPageRangeConverter.cs b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/PrintPageRangeConverter.cs
index 009984cd90919..74b7312125742 100644
--- a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/PrintPageRangeConverter.cs
+++ b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/PrintPageRangeConverter.cs
@@ -17,7 +17,7 @@
// under the License.
//
-using OpenQA.Selenium.BiDi.Modules.BrowsingContext;
+using OpenQA.Selenium.BiDi.BrowsingContext;
using System;
using System.Text.Json;
using System.Text.Json.Serialization;
diff --git a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/RealmConverter.cs b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/RealmConverter.cs
index 4b7f348124fc0..c99f371a3ea5c 100644
--- a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/RealmConverter.cs
+++ b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/RealmConverter.cs
@@ -17,7 +17,7 @@
// under the License.
//
-using OpenQA.Selenium.BiDi.Modules.Script;
+using OpenQA.Selenium.BiDi.Script;
using System;
using System.Text.Json;
using System.Text.Json.Serialization;
diff --git a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/RealmTypeConverter.cs b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/RealmTypeConverter.cs
index 560cb255629c9..5d8cb1d4138e2 100644
--- a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/RealmTypeConverter.cs
+++ b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/RealmTypeConverter.cs
@@ -17,7 +17,7 @@
// under the License.
//
-using OpenQA.Selenium.BiDi.Modules.Script;
+using OpenQA.Selenium.BiDi.Script;
using System;
using System.Text.Json;
using System.Text.Json.Serialization;
diff --git a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/RequestConverter.cs b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/RequestConverter.cs
index 9c45ccc964d6a..3b2265a988a72 100644
--- a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/RequestConverter.cs
+++ b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/RequestConverter.cs
@@ -17,7 +17,7 @@
// under the License.
//
-using OpenQA.Selenium.BiDi.Modules.Network;
+using OpenQA.Selenium.BiDi.Network;
using System;
using System.Text.Json;
using System.Text.Json.Serialization;
diff --git a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/SubscriptionConverter.cs b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/SubscriptionConverter.cs
index cc7157d48c465..1b9cbfdcfad65 100644
--- a/dotnet/src/webdriver/BiDi/Communication/Json/Converters/SubscriptionConverter.cs
+++ b/dotnet/src/webdriver/BiDi/Communication/Json/Converters/SubscriptionConverter.cs
@@ -23,16 +23,16 @@
namespace OpenQA.Selenium.BiDi.Communication.Json.Converters;
-internal class SubscriptionConverter : JsonConverter
+internal class SubscriptionConverter : JsonConverter
{
- public override Modules.Session.Subscription? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+ public override Session.Subscription? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var id = reader.GetString();
- return new Modules.Session.Subscription(id!);
+ return new Session.Subscription(id!);
}
- public override void Write(Utf8JsonWriter writer, Modules.Session.Subscription value, JsonSerializerOptions options)
+ public override void Write(Utf8JsonWriter writer, Session.Subscription value, JsonSerializerOptions options)
{
writer.WriteStringValue(value.Id);
}
diff --git a/dotnet/src/webdriver/BiDi/Communication/Transport/WebSocketTransport.cs b/dotnet/src/webdriver/BiDi/Communication/Transport/WebSocketTransport.cs
index be71e07ed774a..f18e630ca8b16 100644
--- a/dotnet/src/webdriver/BiDi/Communication/Transport/WebSocketTransport.cs
+++ b/dotnet/src/webdriver/BiDi/Communication/Transport/WebSocketTransport.cs
@@ -29,7 +29,7 @@ namespace OpenQA.Selenium.BiDi.Communication.Transport;
class WebSocketTransport(Uri _uri) : ITransport, IDisposable
{
- private readonly static ILogger _logger = Log.GetLogger();
+ private readonly static ILogger _logger = Internal.Logging.Log.GetLogger();
private readonly ClientWebSocket _webSocket = new();
private readonly ArraySegment _receiveBuffer = new(new byte[1024 * 8]);
diff --git a/dotnet/src/webdriver/BiDi/EventArgs.cs b/dotnet/src/webdriver/BiDi/EventArgs.cs
index 5bd9fc9a3ba98..309adddf17a69 100644
--- a/dotnet/src/webdriver/BiDi/EventArgs.cs
+++ b/dotnet/src/webdriver/BiDi/EventArgs.cs
@@ -17,7 +17,6 @@
// under the License.
//
-using OpenQA.Selenium.BiDi.Modules.BrowsingContext;
using System.Text.Json.Serialization;
namespace OpenQA.Selenium.BiDi;
@@ -28,5 +27,5 @@ public abstract record EventArgs(BiDi BiDi)
public BiDi BiDi { get; internal set; } = BiDi;
}
-public abstract record BrowsingContextEventArgs(BiDi BiDi, BrowsingContext Context)
+public abstract record BrowsingContextEventArgs(BiDi BiDi, BrowsingContext.BrowsingContext Context)
: EventArgs(BiDi);
diff --git a/dotnet/src/webdriver/BiDi/Modules/Input/InputModule.cs b/dotnet/src/webdriver/BiDi/Input/InputModule.cs
similarity index 97%
rename from dotnet/src/webdriver/BiDi/Modules/Input/InputModule.cs
rename to dotnet/src/webdriver/BiDi/Input/InputModule.cs
index d8ad18043ffc0..f0905f32b99d2 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Input/InputModule.cs
+++ b/dotnet/src/webdriver/BiDi/Input/InputModule.cs
@@ -21,7 +21,7 @@
using System.Collections.Generic;
using System.Threading.Tasks;
-namespace OpenQA.Selenium.BiDi.Modules.Input;
+namespace OpenQA.Selenium.BiDi.Input;
public sealed class InputModule(Broker broker) : Module(broker)
{
diff --git a/dotnet/src/webdriver/BiDi/Modules/Input/Key.cs b/dotnet/src/webdriver/BiDi/Input/Key.cs
similarity index 97%
rename from dotnet/src/webdriver/BiDi/Modules/Input/Key.cs
rename to dotnet/src/webdriver/BiDi/Input/Key.cs
index b1cb81a3fd785..c016f0a449d21 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Input/Key.cs
+++ b/dotnet/src/webdriver/BiDi/Input/Key.cs
@@ -17,7 +17,7 @@
// under the License.
//
-//partial record Key
+//partial sealed record Key
//{
// public const char Shift = '\uE008';
diff --git a/dotnet/src/webdriver/BiDi/Modules/Input/Origin.cs b/dotnet/src/webdriver/BiDi/Input/Origin.cs
similarity index 81%
rename from dotnet/src/webdriver/BiDi/Modules/Input/Origin.cs
rename to dotnet/src/webdriver/BiDi/Input/Origin.cs
index 3e0241b810f9f..55eb1eb6361f3 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Input/Origin.cs
+++ b/dotnet/src/webdriver/BiDi/Input/Origin.cs
@@ -17,12 +17,12 @@
// under the License.
//
-namespace OpenQA.Selenium.BiDi.Modules.Input;
+namespace OpenQA.Selenium.BiDi.Input;
public abstract record Origin;
-public record ViewportOrigin() : Origin;
+public sealed record ViewportOrigin() : Origin;
-public record PointerOrigin() : Origin;
+public sealed record PointerOrigin() : Origin;
-public record ElementOrigin(Script.ISharedReference Element) : Origin;
+public sealed record ElementOrigin(Script.ISharedReference Element) : Origin;
diff --git a/dotnet/src/webdriver/BiDi/Modules/Input/PerformActionsCommand.cs b/dotnet/src/webdriver/BiDi/Input/PerformActionsCommand.cs
similarity index 76%
rename from dotnet/src/webdriver/BiDi/Modules/Input/PerformActionsCommand.cs
rename to dotnet/src/webdriver/BiDi/Input/PerformActionsCommand.cs
index fab508ee77eb8..be5206baaaf1b 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Input/PerformActionsCommand.cs
+++ b/dotnet/src/webdriver/BiDi/Input/PerformActionsCommand.cs
@@ -20,11 +20,11 @@
using OpenQA.Selenium.BiDi.Communication;
using System.Collections.Generic;
-namespace OpenQA.Selenium.BiDi.Modules.Input;
+namespace OpenQA.Selenium.BiDi.Input;
-internal class PerformActionsCommand(PerformActionsCommandParameters @params)
+internal sealed class PerformActionsCommand(PerformActionsCommandParameters @params)
: Command(@params, "input.performActions");
-internal record PerformActionsCommandParameters(BrowsingContext.BrowsingContext Context, IEnumerable Actions) : CommandParameters;
+internal sealed record PerformActionsCommandParameters(BrowsingContext.BrowsingContext Context, IEnumerable Actions) : CommandParameters;
-public record PerformActionsOptions : CommandOptions;
+public sealed class PerformActionsOptions : CommandOptions;
diff --git a/dotnet/src/webdriver/BiDi/Modules/Input/ReleaseActionsCommand.cs b/dotnet/src/webdriver/BiDi/Input/ReleaseActionsCommand.cs
similarity index 77%
rename from dotnet/src/webdriver/BiDi/Modules/Input/ReleaseActionsCommand.cs
rename to dotnet/src/webdriver/BiDi/Input/ReleaseActionsCommand.cs
index e38969a302086..133c6bdad22be 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Input/ReleaseActionsCommand.cs
+++ b/dotnet/src/webdriver/BiDi/Input/ReleaseActionsCommand.cs
@@ -19,11 +19,11 @@
using OpenQA.Selenium.BiDi.Communication;
-namespace OpenQA.Selenium.BiDi.Modules.Input;
+namespace OpenQA.Selenium.BiDi.Input;
-internal class ReleaseActionsCommand(ReleaseActionsCommandParameters @params)
+internal sealed class ReleaseActionsCommand(ReleaseActionsCommandParameters @params)
: Command(@params, "input.releaseActions");
-internal record ReleaseActionsCommandParameters(BrowsingContext.BrowsingContext Context) : CommandParameters;
+internal sealed record ReleaseActionsCommandParameters(BrowsingContext.BrowsingContext Context) : CommandParameters;
-public record ReleaseActionsOptions : CommandOptions;
+public sealed class ReleaseActionsOptions : CommandOptions;
diff --git a/dotnet/src/webdriver/BiDi/Modules/Input/SequentialSourceActions.cs b/dotnet/src/webdriver/BiDi/Input/SequentialSourceActions.cs
similarity index 99%
rename from dotnet/src/webdriver/BiDi/Modules/Input/SequentialSourceActions.cs
rename to dotnet/src/webdriver/BiDi/Input/SequentialSourceActions.cs
index f7082ab080e53..3fd207145bd6e 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Input/SequentialSourceActions.cs
+++ b/dotnet/src/webdriver/BiDi/Input/SequentialSourceActions.cs
@@ -17,7 +17,7 @@
// under the License.
//
-//namespace OpenQA.Selenium.BiDi.Modules.Input;
+//namespace OpenQA.Selenium.BiDi.Input;
//public interface ISequentialSourceActions : IEnumerable
//{
diff --git a/dotnet/src/webdriver/BiDi/Modules/Input/SetFilesCommand.cs b/dotnet/src/webdriver/BiDi/Input/SetFilesCommand.cs
similarity index 75%
rename from dotnet/src/webdriver/BiDi/Modules/Input/SetFilesCommand.cs
rename to dotnet/src/webdriver/BiDi/Input/SetFilesCommand.cs
index 65489147d3f40..78fdcbf9048a1 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Input/SetFilesCommand.cs
+++ b/dotnet/src/webdriver/BiDi/Input/SetFilesCommand.cs
@@ -20,11 +20,11 @@
using OpenQA.Selenium.BiDi.Communication;
using System.Collections.Generic;
-namespace OpenQA.Selenium.BiDi.Modules.Input;
+namespace OpenQA.Selenium.BiDi.Input;
-internal class SetFilesCommand(SetFilesCommandParameters @params)
+internal sealed class SetFilesCommand(SetFilesCommandParameters @params)
: Command(@params, "input.setFiles");
-internal record SetFilesCommandParameters(BrowsingContext.BrowsingContext Context, Script.ISharedReference Element, IEnumerable Files) : CommandParameters;
+internal sealed record SetFilesCommandParameters(BrowsingContext.BrowsingContext Context, Script.ISharedReference Element, IEnumerable Files) : CommandParameters;
-public record SetFilesOptions : CommandOptions;
+public sealed class SetFilesOptions : CommandOptions;
diff --git a/dotnet/src/webdriver/BiDi/Modules/Input/SourceActions.cs b/dotnet/src/webdriver/BiDi/Input/SourceActions.cs
similarity index 80%
rename from dotnet/src/webdriver/BiDi/Modules/Input/SourceActions.cs
rename to dotnet/src/webdriver/BiDi/Input/SourceActions.cs
index 45e8e70edf79f..7a370c9b18982 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Input/SourceActions.cs
+++ b/dotnet/src/webdriver/BiDi/Input/SourceActions.cs
@@ -22,7 +22,7 @@
using System.Collections.Generic;
using System.Text.Json.Serialization;
-namespace OpenQA.Selenium.BiDi.Modules.Input;
+namespace OpenQA.Selenium.BiDi.Input;
public abstract record SourceActions
{
@@ -31,7 +31,7 @@ public abstract record SourceActions
public interface ISourceAction;
-public record SourceActions : SourceActions, IEnumerable where T : ISourceAction
+public abstract record SourceActions : SourceActions, IEnumerable where T : ISourceAction
{
public IList Actions { get; set; } = [];
@@ -48,7 +48,7 @@ public record SourceActions : SourceActions, IEnumerable where
[JsonDerivedType(typeof(UpKey), "keyUp")]
public interface IKeySourceAction : ISourceAction;
-public record KeyActions : SourceActions
+public sealed record KeyActions : SourceActions
{
public KeyActions Type(string text)
{
@@ -69,7 +69,7 @@ public KeyActions Type(string text)
[JsonDerivedType(typeof(MovePointer), "pointerMove")]
public interface IPointerSourceAction : ISourceAction;
-public record PointerActions : SourceActions
+public sealed record PointerActions : SourceActions
{
public PointerParameters? Options { get; set; }
}
@@ -79,23 +79,23 @@ public record PointerActions : SourceActions
[JsonDerivedType(typeof(ScrollWheel), "scroll")]
public interface IWheelSourceAction : ISourceAction;
-public record WheelActions : SourceActions;
+public sealed record WheelActions : SourceActions;
[JsonPolymorphic(TypeDiscriminatorPropertyName = "type")]
[JsonDerivedType(typeof(Pause), "pause")]
public interface INoneSourceAction : ISourceAction;
-public record NoneActions : SourceActions;
+public sealed record NoneActions : SourceActions;
public abstract record Key : IKeySourceAction;
-public record DownKey(char Value) : Key;
+public sealed record DownKey(char Value) : Key;
-public record UpKey(char Value) : Key;
+public sealed record UpKey(char Value) : Key;
public abstract record Pointer : IPointerSourceAction;
-public record DownPointer(int Button) : Pointer, IPointerCommonProperties
+public sealed record DownPointer(int Button) : Pointer, IPointerCommonProperties
{
public int? Width { get; set; }
public int? Height { get; set; }
@@ -106,9 +106,9 @@ public record DownPointer(int Button) : Pointer, IPointerCommonProperties
public double? AzimuthAngle { get; set; }
}
-public record UpPointer(int Button) : Pointer;
+public sealed record UpPointer(int Button) : Pointer;
-public record MovePointer(int X, int Y) : Pointer, IPointerCommonProperties
+public sealed record MovePointer(int X, int Y) : Pointer, IPointerCommonProperties
{
public int? Duration { get; set; }
@@ -125,7 +125,7 @@ public record MovePointer(int X, int Y) : Pointer, IPointerCommonProperties
public abstract record Wheel : IWheelSourceAction;
-public record ScrollWheel(int X, int Y, int DeltaX, int DeltaY) : Wheel
+public sealed record ScrollWheel(int X, int Y, int DeltaX, int DeltaY) : Wheel
{
public int? Duration { get; set; }
@@ -134,12 +134,12 @@ public record ScrollWheel(int X, int Y, int DeltaX, int DeltaY) : Wheel
public abstract record None : INoneSourceAction;
-public record Pause : ISourceAction, IKeySourceAction, IPointerSourceAction, IWheelSourceAction, INoneSourceAction
+public sealed record Pause : ISourceAction, IKeySourceAction, IPointerSourceAction, IWheelSourceAction, INoneSourceAction
{
public long? Duration { get; set; }
}
-public record PointerParameters
+public sealed record PointerParameters
{
public PointerType? PointerType { get; set; }
}
diff --git a/dotnet/src/webdriver/BiDi/Modules/Log/LogEntry.cs b/dotnet/src/webdriver/BiDi/Log/LogEntry.cs
similarity index 70%
rename from dotnet/src/webdriver/BiDi/Modules/Log/LogEntry.cs
rename to dotnet/src/webdriver/BiDi/Log/LogEntry.cs
index e57761a9f2697..eb6b7ac6df24d 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Log/LogEntry.cs
+++ b/dotnet/src/webdriver/BiDi/Log/LogEntry.cs
@@ -20,26 +20,26 @@
using System;
using System.Collections.Generic;
-namespace OpenQA.Selenium.BiDi.Modules.Log;
+namespace OpenQA.Selenium.BiDi.Log;
// https://github.com/dotnet/runtime/issues/72604
//[JsonPolymorphic(TypeDiscriminatorPropertyName = "type")]
-//[JsonDerivedType(typeof(GenericLogEntry))] // Fallback when discriminator is not recognized, we have to double check
+//[JsonDerivedType(typeof(GenericLogEntry))]
//[JsonDerivedType(typeof(ConsoleLogEntry), "console")]
//[JsonDerivedType(typeof(JavascriptLogEntry), "javascript")]
-public abstract record LogEntry(BiDi BiDi, Level Level, Script.Source Source, string Text, DateTimeOffset Timestamp)
+public abstract record LogEntry(BiDi BiDi, Level Level, Script.Source Source, string? Text, DateTimeOffset Timestamp)
: EventArgs(BiDi)
{
public Script.StackTrace? StackTrace { get; set; }
}
-public record GenericLogEntry(BiDi BiDi, string Type, Level Level, Script.Source Source, string Text, DateTimeOffset Timestamp)
+public sealed record GenericLogEntry(BiDi BiDi, string Type, Level Level, Script.Source Source, string? Text, DateTimeOffset Timestamp)
: LogEntry(BiDi, Level, Source, Text, Timestamp);
-public record ConsoleLogEntry(BiDi BiDi, Level Level, Script.Source Source, string Text, DateTimeOffset Timestamp, string Method, IReadOnlyList Args)
+public sealed record ConsoleLogEntry(BiDi BiDi, Level Level, Script.Source Source, string? Text, DateTimeOffset Timestamp, string Method, IReadOnlyList Args)
: LogEntry(BiDi, Level, Source, Text, Timestamp);
-public record JavascriptLogEntry(BiDi BiDi, Level Level, Script.Source Source, string Text, DateTimeOffset Timestamp)
+public sealed record JavascriptLogEntry(BiDi BiDi, Level Level, Script.Source Source, string? Text, DateTimeOffset Timestamp)
: LogEntry(BiDi, Level, Source, Text, Timestamp);
public enum Level
diff --git a/dotnet/src/webdriver/BiDi/Modules/Log/LogModule.cs b/dotnet/src/webdriver/BiDi/Log/LogModule.cs
similarity index 97%
rename from dotnet/src/webdriver/BiDi/Modules/Log/LogModule.cs
rename to dotnet/src/webdriver/BiDi/Log/LogModule.cs
index f1442ee1ee358..2f3d7f22d1738 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Log/LogModule.cs
+++ b/dotnet/src/webdriver/BiDi/Log/LogModule.cs
@@ -21,7 +21,7 @@
using System;
using OpenQA.Selenium.BiDi.Communication;
-namespace OpenQA.Selenium.BiDi.Modules.Log;
+namespace OpenQA.Selenium.BiDi.Log;
public sealed class LogModule(Broker broker) : Module(broker)
{
diff --git a/dotnet/src/webdriver/BiDi/Modules/Module.cs b/dotnet/src/webdriver/BiDi/Module.cs
similarity index 96%
rename from dotnet/src/webdriver/BiDi/Modules/Module.cs
rename to dotnet/src/webdriver/BiDi/Module.cs
index a24fea89f2f25..6ab1dc0e9bfaf 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Module.cs
+++ b/dotnet/src/webdriver/BiDi/Module.cs
@@ -19,7 +19,7 @@
using OpenQA.Selenium.BiDi.Communication;
-namespace OpenQA.Selenium.BiDi.Modules;
+namespace OpenQA.Selenium.BiDi;
public abstract class Module(Broker broker)
{
diff --git a/dotnet/src/webdriver/BiDi/Modules/Network/FetchTimingInfo.cs b/dotnet/src/webdriver/BiDi/Modules/Network/FetchTimingInfo.cs
deleted file mode 100644
index 08729c40ad2c3..0000000000000
--- a/dotnet/src/webdriver/BiDi/Modules/Network/FetchTimingInfo.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// Licensed to the Software Freedom Conservancy (SFC) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The SFC licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-//
-
-namespace OpenQA.Selenium.BiDi.Modules.Network;
-
-public record FetchTimingInfo(double TimeOrigin,
- double RequestTime,
- double RedirectStart,
- double RedirectEnd,
- double FetchStart,
- double DnsStart,
- double DnsEnd,
- double ConnectStart,
- double ConnectEnd,
- double TlsStart,
- double RequestStart,
- double ResponseStart,
- double ResponseEnd);
diff --git a/dotnet/src/webdriver/BiDi/Modules/Network/AddInterceptCommand.cs b/dotnet/src/webdriver/BiDi/Network/AddInterceptCommand.cs
similarity index 78%
rename from dotnet/src/webdriver/BiDi/Modules/Network/AddInterceptCommand.cs
rename to dotnet/src/webdriver/BiDi/Network/AddInterceptCommand.cs
index e4237b26bc6e4..58ca8831009d6 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Network/AddInterceptCommand.cs
+++ b/dotnet/src/webdriver/BiDi/Network/AddInterceptCommand.cs
@@ -20,14 +20,14 @@
using System.Collections.Generic;
using OpenQA.Selenium.BiDi.Communication;
-namespace OpenQA.Selenium.BiDi.Modules.Network;
+namespace OpenQA.Selenium.BiDi.Network;
-internal class AddInterceptCommand(AddInterceptCommandParameters @params)
+internal sealed class AddInterceptCommand(AddInterceptCommandParameters @params)
: Command(@params, "network.addIntercept");
-internal record AddInterceptCommandParameters(IEnumerable Phases, IEnumerable? Contexts, IEnumerable? UrlPatterns) : CommandParameters;
+internal sealed record AddInterceptCommandParameters(IEnumerable Phases, IEnumerable? Contexts, IEnumerable? UrlPatterns) : CommandParameters;
-public record AddInterceptOptions : CommandOptions
+public class AddInterceptOptions : CommandOptions
{
public AddInterceptOptions() { }
@@ -46,7 +46,7 @@ public record BrowsingContextAddInterceptOptions
public IEnumerable? UrlPatterns { get; set; }
}
-public record AddInterceptResult(Intercept Intercept) : EmptyResult;
+public sealed record AddInterceptResult(Intercept Intercept) : EmptyResult;
public enum InterceptPhase
{
diff --git a/dotnet/src/webdriver/BiDi/Modules/Network/AuthChallenge.cs b/dotnet/src/webdriver/BiDi/Network/AuthChallenge.cs
similarity index 89%
rename from dotnet/src/webdriver/BiDi/Modules/Network/AuthChallenge.cs
rename to dotnet/src/webdriver/BiDi/Network/AuthChallenge.cs
index 73c1711b28cbe..4eccd4c77a3d1 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Network/AuthChallenge.cs
+++ b/dotnet/src/webdriver/BiDi/Network/AuthChallenge.cs
@@ -17,6 +17,6 @@
// under the License.
//
-namespace OpenQA.Selenium.BiDi.Modules.Network;
+namespace OpenQA.Selenium.BiDi.Network;
-public record AuthChallenge(string Scheme, string Realm);
+public sealed record AuthChallenge(string Scheme, string Realm);
diff --git a/dotnet/src/webdriver/BiDi/Modules/Network/AuthCredentials.cs b/dotnet/src/webdriver/BiDi/Network/AuthCredentials.cs
similarity index 89%
rename from dotnet/src/webdriver/BiDi/Modules/Network/AuthCredentials.cs
rename to dotnet/src/webdriver/BiDi/Network/AuthCredentials.cs
index f3bd0343a557b..9aea88ebde836 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Network/AuthCredentials.cs
+++ b/dotnet/src/webdriver/BiDi/Network/AuthCredentials.cs
@@ -19,9 +19,9 @@
using System.Text.Json.Serialization;
-namespace OpenQA.Selenium.BiDi.Modules.Network;
+namespace OpenQA.Selenium.BiDi.Network;
-public record AuthCredentials(string Username, string Password)
+public sealed record AuthCredentials(string Username, string Password)
{
[JsonInclude]
internal string Type { get; } = "password";
diff --git a/dotnet/src/webdriver/BiDi/Modules/Network/AuthRequiredEventArgs.cs b/dotnet/src/webdriver/BiDi/Network/AuthRequiredEventArgs.cs
similarity index 83%
rename from dotnet/src/webdriver/BiDi/Modules/Network/AuthRequiredEventArgs.cs
rename to dotnet/src/webdriver/BiDi/Network/AuthRequiredEventArgs.cs
index ed2f461a17723..e933e0e29dfb5 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Network/AuthRequiredEventArgs.cs
+++ b/dotnet/src/webdriver/BiDi/Network/AuthRequiredEventArgs.cs
@@ -19,7 +19,7 @@
using System;
-namespace OpenQA.Selenium.BiDi.Modules.Network;
+namespace OpenQA.Selenium.BiDi.Network;
-public record AuthRequiredEventArgs(BiDi BiDi, BrowsingContext.BrowsingContext Context, bool IsBlocked, BrowsingContext.Navigation Navigation, long RedirectCount, RequestData Request, DateTimeOffset Timestamp, ResponseData Response) :
+public record AuthRequiredEventArgs(BiDi BiDi, BrowsingContext.BrowsingContext? Context, bool IsBlocked, BrowsingContext.Navigation? Navigation, long RedirectCount, RequestData Request, DateTimeOffset Timestamp, ResponseData Response) :
BaseParametersEventArgs(BiDi, Context, IsBlocked, Navigation, RedirectCount, Request, Timestamp);
diff --git a/dotnet/src/webdriver/BiDi/Modules/Network/BaseParametersEventArgs.cs b/dotnet/src/webdriver/BiDi/Network/BaseParametersEventArgs.cs
similarity index 85%
rename from dotnet/src/webdriver/BiDi/Modules/Network/BaseParametersEventArgs.cs
rename to dotnet/src/webdriver/BiDi/Network/BaseParametersEventArgs.cs
index 58cf915a20e82..a1c990228a2eb 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Network/BaseParametersEventArgs.cs
+++ b/dotnet/src/webdriver/BiDi/Network/BaseParametersEventArgs.cs
@@ -21,9 +21,9 @@
using System.Text.Json.Serialization;
using System;
-namespace OpenQA.Selenium.BiDi.Modules.Network;
+namespace OpenQA.Selenium.BiDi.Network;
-public abstract record BaseParametersEventArgs(BiDi BiDi, BrowsingContext.BrowsingContext Context, bool IsBlocked, BrowsingContext.Navigation Navigation, long RedirectCount, RequestData Request, DateTimeOffset Timestamp)
+public abstract record BaseParametersEventArgs(BiDi BiDi, BrowsingContext.BrowsingContext? Context, bool IsBlocked, BrowsingContext.Navigation? Navigation, long RedirectCount, RequestData Request, DateTimeOffset Timestamp)
: BrowsingContextEventArgs(BiDi, Context)
{
[JsonInclude]
diff --git a/dotnet/src/webdriver/BiDi/Modules/Network/BeforeRequestSentEventArgs.cs b/dotnet/src/webdriver/BiDi/Network/BeforeRequestSentEventArgs.cs
similarity index 80%
rename from dotnet/src/webdriver/BiDi/Modules/Network/BeforeRequestSentEventArgs.cs
rename to dotnet/src/webdriver/BiDi/Network/BeforeRequestSentEventArgs.cs
index 5315777c798e9..7524878c2141d 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Network/BeforeRequestSentEventArgs.cs
+++ b/dotnet/src/webdriver/BiDi/Network/BeforeRequestSentEventArgs.cs
@@ -17,10 +17,10 @@
// under the License.
//
-using OpenQA.Selenium.BiDi.Modules.BrowsingContext;
+using OpenQA.Selenium.BiDi.BrowsingContext;
using System;
-namespace OpenQA.Selenium.BiDi.Modules.Network;
+namespace OpenQA.Selenium.BiDi.Network;
-public record BeforeRequestSentEventArgs(BiDi BiDi, BrowsingContext.BrowsingContext Context, bool IsBlocked, Navigation Navigation, long RedirectCount, RequestData Request, DateTimeOffset Timestamp, Initiator Initiator)
+public record BeforeRequestSentEventArgs(BiDi BiDi, BrowsingContext.BrowsingContext? Context, bool IsBlocked, Navigation? Navigation, long RedirectCount, RequestData Request, DateTimeOffset Timestamp, Initiator Initiator)
: BaseParametersEventArgs(BiDi, Context, IsBlocked, Navigation, RedirectCount, Request, Timestamp);
diff --git a/dotnet/src/webdriver/BiDi/Modules/Network/BytesValue.cs b/dotnet/src/webdriver/BiDi/Network/BytesValue.cs
similarity index 88%
rename from dotnet/src/webdriver/BiDi/Modules/Network/BytesValue.cs
rename to dotnet/src/webdriver/BiDi/Network/BytesValue.cs
index 9b7154b213832..9952bff13f1c2 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Network/BytesValue.cs
+++ b/dotnet/src/webdriver/BiDi/Network/BytesValue.cs
@@ -20,7 +20,7 @@
using System;
using System.Text.Json.Serialization;
-namespace OpenQA.Selenium.BiDi.Modules.Network;
+namespace OpenQA.Selenium.BiDi.Network;
[JsonPolymorphic(TypeDiscriminatorPropertyName = "type")]
[JsonDerivedType(typeof(StringBytesValue), "string")]
@@ -31,6 +31,6 @@ public abstract record BytesValue
public static implicit operator BytesValue(byte[] value) => new Base64BytesValue(Convert.ToBase64String(value));
}
-public record StringBytesValue(string Value) : BytesValue;
+public sealed record StringBytesValue(string Value) : BytesValue;
-public record Base64BytesValue(string Value) : BytesValue;
+public sealed record Base64BytesValue(string Value) : BytesValue;
diff --git a/dotnet/src/webdriver/BiDi/Modules/Network/ContinueRequestCommand.cs b/dotnet/src/webdriver/BiDi/Network/ContinueRequestCommand.cs
similarity index 76%
rename from dotnet/src/webdriver/BiDi/Modules/Network/ContinueRequestCommand.cs
rename to dotnet/src/webdriver/BiDi/Network/ContinueRequestCommand.cs
index 6054610f61022..786ed9d68ca60 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Network/ContinueRequestCommand.cs
+++ b/dotnet/src/webdriver/BiDi/Network/ContinueRequestCommand.cs
@@ -20,14 +20,14 @@
using OpenQA.Selenium.BiDi.Communication;
using System.Collections.Generic;
-namespace OpenQA.Selenium.BiDi.Modules.Network;
+namespace OpenQA.Selenium.BiDi.Network;
-internal class ContinueRequestCommand(ContinueRequestCommandParameters @params)
+internal sealed class ContinueRequestCommand(ContinueRequestCommandParameters @params)
: Command(@params, "network.continueRequest");
-internal record ContinueRequestCommandParameters(Request Request, BytesValue? Body, IEnumerable? Cookies, IEnumerable? Headers, string? Method, string? Url) : CommandParameters;
+internal sealed record ContinueRequestCommandParameters(Request Request, BytesValue? Body, IEnumerable? Cookies, IEnumerable? Headers, string? Method, string? Url) : CommandParameters;
-public record ContinueRequestOptions : CommandOptions
+public sealed class ContinueRequestOptions : CommandOptions
{
public BytesValue? Body { get; set; }
diff --git a/dotnet/src/webdriver/BiDi/Modules/Network/ContinueResponseCommand.cs b/dotnet/src/webdriver/BiDi/Network/ContinueResponseCommand.cs
similarity index 75%
rename from dotnet/src/webdriver/BiDi/Modules/Network/ContinueResponseCommand.cs
rename to dotnet/src/webdriver/BiDi/Network/ContinueResponseCommand.cs
index 86127f89ab6e2..06ce733eb27d2 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Network/ContinueResponseCommand.cs
+++ b/dotnet/src/webdriver/BiDi/Network/ContinueResponseCommand.cs
@@ -20,14 +20,14 @@
using OpenQA.Selenium.BiDi.Communication;
using System.Collections.Generic;
-namespace OpenQA.Selenium.BiDi.Modules.Network;
+namespace OpenQA.Selenium.BiDi.Network;
-internal class ContinueResponseCommand(ContinueResponseCommandParameters @params)
+internal sealed class ContinueResponseCommand(ContinueResponseCommandParameters @params)
: Command(@params, "network.continueResponse");
-internal record ContinueResponseCommandParameters(Request Request, IEnumerable? Cookies, IEnumerable? Credentials, IEnumerable? Headers, string? ReasonPhrase, long? StatusCode) : CommandParameters;
+internal sealed record ContinueResponseCommandParameters(Request Request, IEnumerable? Cookies, IEnumerable? Credentials, IEnumerable? Headers, string? ReasonPhrase, long? StatusCode) : CommandParameters;
-public record ContinueResponseOptions : CommandOptions
+public sealed class ContinueResponseOptions : CommandOptions
{
public IEnumerable? Cookies { get; set; }
diff --git a/dotnet/src/webdriver/BiDi/Modules/Network/ContinueWithAuthCommand.cs b/dotnet/src/webdriver/BiDi/Network/ContinueWithAuthCommand.cs
similarity index 66%
rename from dotnet/src/webdriver/BiDi/Modules/Network/ContinueWithAuthCommand.cs
rename to dotnet/src/webdriver/BiDi/Network/ContinueWithAuthCommand.cs
index 1a7b263b8419c..bd41e31c6d704 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Network/ContinueWithAuthCommand.cs
+++ b/dotnet/src/webdriver/BiDi/Network/ContinueWithAuthCommand.cs
@@ -20,7 +20,7 @@
using OpenQA.Selenium.BiDi.Communication;
using System.Text.Json.Serialization;
-namespace OpenQA.Selenium.BiDi.Modules.Network;
+namespace OpenQA.Selenium.BiDi.Network;
internal class ContinueWithAuthCommand(ContinueWithAuthParameters @params)
: Command(@params, "network.continueWithAuth");
@@ -31,21 +31,21 @@ internal class ContinueWithAuthCommand(ContinueWithAuthParameters @params)
[JsonDerivedType(typeof(ContinueWithAuthCancelCredentials), "cancel")]
internal abstract record ContinueWithAuthParameters(Request Request) : CommandParameters;
-internal record ContinueWithAuthCredentials(Request Request, AuthCredentials Credentials) : ContinueWithAuthParameters(Request);
+internal sealed record ContinueWithAuthCredentials(Request Request, AuthCredentials Credentials) : ContinueWithAuthParameters(Request);
internal abstract record ContinueWithAuthNoCredentials(Request Request) : ContinueWithAuthParameters(Request);
-internal record ContinueWithAuthDefaultCredentials(Request Request) : ContinueWithAuthNoCredentials(Request);
+internal sealed record ContinueWithAuthDefaultCredentials(Request Request) : ContinueWithAuthNoCredentials(Request);
-internal record ContinueWithAuthCancelCredentials(Request Request) : ContinueWithAuthNoCredentials(Request);
+internal sealed record ContinueWithAuthCancelCredentials(Request Request) : ContinueWithAuthNoCredentials(Request);
-public record ContinueWithAuthOptions : CommandOptions;
+public abstract class ContinueWithAuthOptions : CommandOptions;
-public record ContinueWithAuthCredentialsOptions : ContinueWithAuthOptions;
+public sealed class ContinueWithAuthCredentialsOptions : ContinueWithAuthOptions;
-public record ContinueWithAuthNoCredentialsOptions : ContinueWithAuthOptions;
+public abstract class ContinueWithAuthNoCredentialsOptions : ContinueWithAuthOptions;
-public record ContinueWithAuthDefaultCredentialsOptions : ContinueWithAuthNoCredentialsOptions;
+public sealed class ContinueWithAuthDefaultCredentialsOptions : ContinueWithAuthNoCredentialsOptions;
-public record ContinueWithAuthCancelCredentialsOptions : ContinueWithAuthNoCredentialsOptions;
+public sealed class ContinueWithAuthCancelCredentialsOptions : ContinueWithAuthNoCredentialsOptions;
diff --git a/dotnet/src/webdriver/BiDi/Modules/Network/Cookie.cs b/dotnet/src/webdriver/BiDi/Network/Cookie.cs
similarity index 85%
rename from dotnet/src/webdriver/BiDi/Modules/Network/Cookie.cs
rename to dotnet/src/webdriver/BiDi/Network/Cookie.cs
index 98754195731f2..7b17f0c48dcbc 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Network/Cookie.cs
+++ b/dotnet/src/webdriver/BiDi/Network/Cookie.cs
@@ -20,9 +20,9 @@
using System;
using System.Text.Json.Serialization;
-namespace OpenQA.Selenium.BiDi.Modules.Network;
+namespace OpenQA.Selenium.BiDi.Network;
-public record Cookie(string Name, BytesValue Value, string Domain, string Path, long Size, bool HttpOnly, bool Secure, SameSite SameSite)
+public sealed record Cookie(string Name, BytesValue Value, string Domain, string Path, long Size, bool HttpOnly, bool Secure, SameSite SameSite)
{
[JsonInclude]
public DateTimeOffset? Expiry { get; internal set; }
diff --git a/dotnet/src/webdriver/BiDi/Modules/Network/CookieHeader.cs b/dotnet/src/webdriver/BiDi/Network/CookieHeader.cs
similarity index 89%
rename from dotnet/src/webdriver/BiDi/Modules/Network/CookieHeader.cs
rename to dotnet/src/webdriver/BiDi/Network/CookieHeader.cs
index aa0c26ad15d1f..979b825ceb8c2 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Network/CookieHeader.cs
+++ b/dotnet/src/webdriver/BiDi/Network/CookieHeader.cs
@@ -17,6 +17,6 @@
// under the License.
//
-namespace OpenQA.Selenium.BiDi.Modules.Network;
+namespace OpenQA.Selenium.BiDi.Network;
-public record CookieHeader(string Name, BytesValue Value);
+public sealed record CookieHeader(string Name, BytesValue Value);
diff --git a/dotnet/src/webdriver/BiDi/Modules/Network/FailRequestCommand.cs b/dotnet/src/webdriver/BiDi/Network/FailRequestCommand.cs
similarity index 79%
rename from dotnet/src/webdriver/BiDi/Modules/Network/FailRequestCommand.cs
rename to dotnet/src/webdriver/BiDi/Network/FailRequestCommand.cs
index 8f8f58c86d006..1c2cdbafab295 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Network/FailRequestCommand.cs
+++ b/dotnet/src/webdriver/BiDi/Network/FailRequestCommand.cs
@@ -19,11 +19,11 @@
using OpenQA.Selenium.BiDi.Communication;
-namespace OpenQA.Selenium.BiDi.Modules.Network;
+namespace OpenQA.Selenium.BiDi.Network;
-internal class FailRequestCommand(FailRequestCommandParameters @params)
+internal sealed class FailRequestCommand(FailRequestCommandParameters @params)
: Command(@params, "network.failRequest");
-internal record FailRequestCommandParameters(Request Request) : CommandParameters;
+internal sealed record FailRequestCommandParameters(Request Request) : CommandParameters;
-public record FailRequestOptions : CommandOptions;
+public sealed class FailRequestOptions : CommandOptions;
diff --git a/dotnet/src/webdriver/BiDi/Modules/Network/FetchErrorEventArgs.cs b/dotnet/src/webdriver/BiDi/Network/FetchErrorEventArgs.cs
similarity index 76%
rename from dotnet/src/webdriver/BiDi/Modules/Network/FetchErrorEventArgs.cs
rename to dotnet/src/webdriver/BiDi/Network/FetchErrorEventArgs.cs
index 4a4b5b320ba4b..829d73aa45413 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Network/FetchErrorEventArgs.cs
+++ b/dotnet/src/webdriver/BiDi/Network/FetchErrorEventArgs.cs
@@ -17,10 +17,10 @@
// under the License.
//
-using OpenQA.Selenium.BiDi.Modules.BrowsingContext;
+using OpenQA.Selenium.BiDi.BrowsingContext;
using System;
-namespace OpenQA.Selenium.BiDi.Modules.Network;
+namespace OpenQA.Selenium.BiDi.Network;
-public record FetchErrorEventArgs(BiDi BiDi, BrowsingContext.BrowsingContext Context, bool IsBlocked, Navigation Navigation, long RedirectCount, RequestData Request, DateTimeOffset Timestamp, string ErrorText)
+public sealed record FetchErrorEventArgs(BiDi BiDi, BrowsingContext.BrowsingContext? Context, bool IsBlocked, Navigation? Navigation, long RedirectCount, RequestData Request, DateTimeOffset Timestamp, string ErrorText)
: BaseParametersEventArgs(BiDi, Context, IsBlocked, Navigation, RedirectCount, Request, Timestamp);
diff --git a/dotnet/src/webdriver/BiDi/Network/FetchTimingInfo.cs b/dotnet/src/webdriver/BiDi/Network/FetchTimingInfo.cs
new file mode 100644
index 0000000000000..af3382002f252
--- /dev/null
+++ b/dotnet/src/webdriver/BiDi/Network/FetchTimingInfo.cs
@@ -0,0 +1,35 @@
+//
+// Licensed to the Software Freedom Conservancy (SFC) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The SFC licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+
+namespace OpenQA.Selenium.BiDi.Network;
+
+public sealed record FetchTimingInfo(
+ double TimeOrigin,
+ double RequestTime,
+ double RedirectStart,
+ double RedirectEnd,
+ double FetchStart,
+ double DnsStart,
+ double DnsEnd,
+ double ConnectStart,
+ double ConnectEnd,
+ double TlsStart,
+ double RequestStart,
+ double ResponseStart,
+ double ResponseEnd);
diff --git a/dotnet/src/webdriver/BiDi/Modules/Network/Header.cs b/dotnet/src/webdriver/BiDi/Network/Header.cs
similarity index 89%
rename from dotnet/src/webdriver/BiDi/Modules/Network/Header.cs
rename to dotnet/src/webdriver/BiDi/Network/Header.cs
index 00d8414cd2d67..ee70eb00dff82 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Network/Header.cs
+++ b/dotnet/src/webdriver/BiDi/Network/Header.cs
@@ -17,6 +17,6 @@
// under the License.
//
-namespace OpenQA.Selenium.BiDi.Modules.Network;
+namespace OpenQA.Selenium.BiDi.Network;
-public record Header(string Name, BytesValue Value);
+public sealed record Header(string Name, BytesValue Value);
diff --git a/dotnet/src/webdriver/BiDi/Modules/Network/Initiator.cs b/dotnet/src/webdriver/BiDi/Network/Initiator.cs
similarity index 92%
rename from dotnet/src/webdriver/BiDi/Modules/Network/Initiator.cs
rename to dotnet/src/webdriver/BiDi/Network/Initiator.cs
index c9cc0bf5f0f91..cea2a48e59f98 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Network/Initiator.cs
+++ b/dotnet/src/webdriver/BiDi/Network/Initiator.cs
@@ -17,9 +17,9 @@
// under the License.
//
-namespace OpenQA.Selenium.BiDi.Modules.Network;
+namespace OpenQA.Selenium.BiDi.Network;
-public record Initiator(InitiatorType Type)
+public sealed record Initiator(InitiatorType Type)
{
public long? ColumnNumber { get; set; }
diff --git a/dotnet/src/webdriver/BiDi/Modules/Network/Intercept.cs b/dotnet/src/webdriver/BiDi/Network/Intercept.cs
similarity index 92%
rename from dotnet/src/webdriver/BiDi/Modules/Network/Intercept.cs
rename to dotnet/src/webdriver/BiDi/Network/Intercept.cs
index 0f7758511d974..c266f791efaa3 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Network/Intercept.cs
+++ b/dotnet/src/webdriver/BiDi/Network/Intercept.cs
@@ -22,9 +22,9 @@
using System.Linq;
using System.Threading.Tasks;
-namespace OpenQA.Selenium.BiDi.Modules.Network;
+namespace OpenQA.Selenium.BiDi.Network;
-public class Intercept : IAsyncDisposable
+public sealed class Intercept : IAsyncDisposable
{
private readonly BiDi _bidi;
@@ -36,9 +36,9 @@ internal Intercept(BiDi bidi, string id)
internal string Id { get; }
- protected IList OnBeforeRequestSentSubscriptions { get; } = [];
- protected IList OnResponseStartedSubscriptions { get; } = [];
- protected IList OnAuthRequiredSubscriptions { get; } = [];
+ IList OnBeforeRequestSentSubscriptions { get; } = [];
+ IList OnResponseStartedSubscriptions { get; } = [];
+ IList OnAuthRequiredSubscriptions { get; } = [];
public async Task RemoveAsync()
{
diff --git a/dotnet/src/webdriver/BiDi/Modules/Network/NetworkModule.HighLevel.cs b/dotnet/src/webdriver/BiDi/Network/NetworkModule.HighLevel.cs
similarity index 80%
rename from dotnet/src/webdriver/BiDi/Modules/Network/NetworkModule.HighLevel.cs
rename to dotnet/src/webdriver/BiDi/Network/NetworkModule.HighLevel.cs
index 3ba468219c671..b2137c8c9ec31 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Network/NetworkModule.HighLevel.cs
+++ b/dotnet/src/webdriver/BiDi/Network/NetworkModule.HighLevel.cs
@@ -20,7 +20,7 @@
using System;
using System.Threading.Tasks;
-namespace OpenQA.Selenium.BiDi.Modules.Network;
+namespace OpenQA.Selenium.BiDi.Network;
public partial class NetworkModule
{
@@ -52,13 +52,13 @@ public async Task InterceptAuthAsync(Func hand
}
}
-public record InterceptRequestOptions : AddInterceptOptions;
+public sealed class InterceptRequestOptions : AddInterceptOptions;
-public record InterceptResponseOptions : AddInterceptOptions;
+public sealed class InterceptResponseOptions : AddInterceptOptions;
-public record InterceptAuthOptions : AddInterceptOptions;
+public sealed class InterceptAuthOptions : AddInterceptOptions;
-public record InterceptedRequest(BiDi BiDi, BrowsingContext.BrowsingContext Context, bool IsBlocked, BrowsingContext.Navigation Navigation, long RedirectCount, RequestData Request, DateTimeOffset Timestamp, Initiator Initiator)
+public sealed record InterceptedRequest(BiDi BiDi, BrowsingContext.BrowsingContext? Context, bool IsBlocked, BrowsingContext.Navigation? Navigation, long RedirectCount, RequestData Request, DateTimeOffset Timestamp, Initiator Initiator)
: BeforeRequestSentEventArgs(BiDi, Context, IsBlocked, Navigation, RedirectCount, Request, Timestamp, Initiator)
{
public Task ContinueAsync(ContinueRequestOptions? options = null)
@@ -77,7 +77,7 @@ public Task ProvideResponseAsync(ProvideResponseOptions? options = null)
}
}
-public record InterceptedResponse(BiDi BiDi, BrowsingContext.BrowsingContext Context, bool IsBlocked, BrowsingContext.Navigation Navigation, long RedirectCount, RequestData Request, DateTimeOffset Timestamp, ResponseData Response)
+public sealed record InterceptedResponse(BiDi BiDi, BrowsingContext.BrowsingContext? Context, bool IsBlocked, BrowsingContext.Navigation? Navigation, long RedirectCount, RequestData Request, DateTimeOffset Timestamp, ResponseData Response)
: ResponseStartedEventArgs(BiDi, Context, IsBlocked, Navigation, RedirectCount, Request, Timestamp, Response)
{
public Task ContinueAsync(ContinueResponseOptions? options = null)
@@ -86,7 +86,7 @@ public Task ContinueAsync(ContinueResponseOptions? options = null)
}
}
-public record InterceptedAuth(BiDi BiDi, BrowsingContext.BrowsingContext Context, bool IsBlocked, BrowsingContext.Navigation Navigation, long RedirectCount, RequestData Request, DateTimeOffset Timestamp, ResponseData Response)
+public sealed record InterceptedAuth(BiDi BiDi, BrowsingContext.BrowsingContext? Context, bool IsBlocked, BrowsingContext.Navigation? Navigation, long RedirectCount, RequestData Request, DateTimeOffset Timestamp, ResponseData Response)
: AuthRequiredEventArgs(BiDi, Context, IsBlocked, Navigation, RedirectCount, Request, Timestamp, Response)
{
public Task ContinueAsync(AuthCredentials credentials, ContinueWithAuthCredentialsOptions? options = null)
diff --git a/dotnet/src/webdriver/BiDi/Modules/Network/NetworkModule.cs b/dotnet/src/webdriver/BiDi/Network/NetworkModule.cs
similarity index 99%
rename from dotnet/src/webdriver/BiDi/Modules/Network/NetworkModule.cs
rename to dotnet/src/webdriver/BiDi/Network/NetworkModule.cs
index 7d31bc344d41b..ef87b18dd0a0f 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Network/NetworkModule.cs
+++ b/dotnet/src/webdriver/BiDi/Network/NetworkModule.cs
@@ -22,7 +22,7 @@
using System.Threading.Tasks;
using OpenQA.Selenium.BiDi.Communication;
-namespace OpenQA.Selenium.BiDi.Modules.Network;
+namespace OpenQA.Selenium.BiDi.Network;
public sealed partial class NetworkModule(Broker broker) : Module(broker)
{
diff --git a/dotnet/src/webdriver/BiDi/Modules/Network/ProvideResponseCommand.cs b/dotnet/src/webdriver/BiDi/Network/ProvideResponseCommand.cs
similarity index 76%
rename from dotnet/src/webdriver/BiDi/Modules/Network/ProvideResponseCommand.cs
rename to dotnet/src/webdriver/BiDi/Network/ProvideResponseCommand.cs
index cb11ddd5ffe2d..679dc088b6998 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Network/ProvideResponseCommand.cs
+++ b/dotnet/src/webdriver/BiDi/Network/ProvideResponseCommand.cs
@@ -20,14 +20,14 @@
using OpenQA.Selenium.BiDi.Communication;
using System.Collections.Generic;
-namespace OpenQA.Selenium.BiDi.Modules.Network;
+namespace OpenQA.Selenium.BiDi.Network;
-internal class ProvideResponseCommand(ProvideResponseCommandParameters @params)
+internal sealed class ProvideResponseCommand(ProvideResponseCommandParameters @params)
: Command(@params, "network.provideResponse");
-internal record ProvideResponseCommandParameters(Request Request, BytesValue? Body, IEnumerable? Cookies, IEnumerable? Headers, string? ReasonPhrase, long? StatusCode) : CommandParameters;
+internal sealed record ProvideResponseCommandParameters(Request Request, BytesValue? Body, IEnumerable? Cookies, IEnumerable? Headers, string? ReasonPhrase, long? StatusCode) : CommandParameters;
-public record ProvideResponseOptions : CommandOptions
+public sealed class ProvideResponseOptions : CommandOptions
{
public BytesValue? Body { get; set; }
diff --git a/dotnet/src/webdriver/BiDi/Modules/Network/RemoveInterceptCommand.cs b/dotnet/src/webdriver/BiDi/Network/RemoveInterceptCommand.cs
similarity index 78%
rename from dotnet/src/webdriver/BiDi/Modules/Network/RemoveInterceptCommand.cs
rename to dotnet/src/webdriver/BiDi/Network/RemoveInterceptCommand.cs
index 32760dbc029f3..179c18d68d089 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Network/RemoveInterceptCommand.cs
+++ b/dotnet/src/webdriver/BiDi/Network/RemoveInterceptCommand.cs
@@ -19,11 +19,11 @@
using OpenQA.Selenium.BiDi.Communication;
-namespace OpenQA.Selenium.BiDi.Modules.Network;
+namespace OpenQA.Selenium.BiDi.Network;
-internal class RemoveInterceptCommand(RemoveInterceptCommandParameters @params)
+internal sealed class RemoveInterceptCommand(RemoveInterceptCommandParameters @params)
: Command(@params, "network.removeIntercept");
-internal record RemoveInterceptCommandParameters(Intercept Intercept) : CommandParameters;
+internal sealed record RemoveInterceptCommandParameters(Intercept Intercept) : CommandParameters;
-public record RemoveInterceptOptions : CommandOptions;
+public class RemoveInterceptOptions : CommandOptions;
diff --git a/dotnet/src/webdriver/BiDi/Modules/Network/Request.cs b/dotnet/src/webdriver/BiDi/Network/Request.cs
similarity index 93%
rename from dotnet/src/webdriver/BiDi/Modules/Network/Request.cs
rename to dotnet/src/webdriver/BiDi/Network/Request.cs
index 870b6a129db85..0182c49838205 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Network/Request.cs
+++ b/dotnet/src/webdriver/BiDi/Network/Request.cs
@@ -17,9 +17,9 @@
// under the License.
//
-namespace OpenQA.Selenium.BiDi.Modules.Network;
+namespace OpenQA.Selenium.BiDi.Network;
-public class Request
+public sealed class Request
{
internal Request(string id)
{
diff --git a/dotnet/src/webdriver/BiDi/Modules/Network/RequestData.cs b/dotnet/src/webdriver/BiDi/Network/RequestData.cs
similarity index 74%
rename from dotnet/src/webdriver/BiDi/Modules/Network/RequestData.cs
rename to dotnet/src/webdriver/BiDi/Network/RequestData.cs
index 6083cf92454ab..53e7f1de7e17e 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Network/RequestData.cs
+++ b/dotnet/src/webdriver/BiDi/Network/RequestData.cs
@@ -19,6 +19,16 @@
using System.Collections.Generic;
-namespace OpenQA.Selenium.BiDi.Modules.Network;
+namespace OpenQA.Selenium.BiDi.Network;
-public record RequestData(Request Request, string Url, string Method, IReadOnlyList Headers, IReadOnlyList Cookies, long HeadersSize, long? BodySize, FetchTimingInfo Timings);
+public sealed record RequestData(
+ Request Request,
+ string Url,
+ string Method,
+ IReadOnlyList Headers,
+ IReadOnlyList Cookies,
+ long? HeadersSize,
+ long? BodySize,
+ string Destination,
+ string? InitiatorType,
+ FetchTimingInfo Timings);
diff --git a/dotnet/src/webdriver/BiDi/Modules/Network/ResponseCompletedEventArgs.cs b/dotnet/src/webdriver/BiDi/Network/ResponseCompletedEventArgs.cs
similarity index 74%
rename from dotnet/src/webdriver/BiDi/Modules/Network/ResponseCompletedEventArgs.cs
rename to dotnet/src/webdriver/BiDi/Network/ResponseCompletedEventArgs.cs
index ff03768ee183d..3cd7ea5dad54e 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Network/ResponseCompletedEventArgs.cs
+++ b/dotnet/src/webdriver/BiDi/Network/ResponseCompletedEventArgs.cs
@@ -17,10 +17,17 @@
// under the License.
//
-using OpenQA.Selenium.BiDi.Modules.BrowsingContext;
+using OpenQA.Selenium.BiDi.BrowsingContext;
using System;
-namespace OpenQA.Selenium.BiDi.Modules.Network;
+namespace OpenQA.Selenium.BiDi.Network;
-public record ResponseCompletedEventArgs(BiDi BiDi, BrowsingContext.BrowsingContext Context, bool IsBlocked, Navigation Navigation, long RedirectCount, RequestData Request, DateTimeOffset Timestamp, ResponseData Response)
+public sealed record ResponseCompletedEventArgs(BiDi BiDi,
+ BrowsingContext.BrowsingContext? Context,
+ bool IsBlocked,
+ Navigation? Navigation,
+ long RedirectCount,
+ RequestData Request,
+ DateTimeOffset Timestamp,
+ ResponseData Response)
: BaseParametersEventArgs(BiDi, Context, IsBlocked, Navigation, RedirectCount, Request, Timestamp);
diff --git a/dotnet/src/webdriver/BiDi/Modules/Network/ResponseContent.cs b/dotnet/src/webdriver/BiDi/Network/ResponseContent.cs
similarity index 90%
rename from dotnet/src/webdriver/BiDi/Modules/Network/ResponseContent.cs
rename to dotnet/src/webdriver/BiDi/Network/ResponseContent.cs
index 0e76e0c90c35d..c8e031f4c0bae 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Network/ResponseContent.cs
+++ b/dotnet/src/webdriver/BiDi/Network/ResponseContent.cs
@@ -17,6 +17,6 @@
// under the License.
//
-namespace OpenQA.Selenium.BiDi.Modules.Network;
+namespace OpenQA.Selenium.BiDi.Network;
-public record ResponseContent(long Size);
+public sealed record ResponseContent(long Size);
diff --git a/dotnet/src/webdriver/BiDi/Modules/Network/ResponseData.cs b/dotnet/src/webdriver/BiDi/Network/ResponseData.cs
similarity index 67%
rename from dotnet/src/webdriver/BiDi/Modules/Network/ResponseData.cs
rename to dotnet/src/webdriver/BiDi/Network/ResponseData.cs
index 68063ffc5d269..87868bde43534 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Network/ResponseData.cs
+++ b/dotnet/src/webdriver/BiDi/Network/ResponseData.cs
@@ -20,19 +20,19 @@
using System.Collections.Generic;
using System.Text.Json.Serialization;
-namespace OpenQA.Selenium.BiDi.Modules.Network;
+namespace OpenQA.Selenium.BiDi.Network;
public record ResponseData(string Url,
- string Protocol,
- int Status, // TODO: should be unit
- string StatusText,
- bool FromCache,
- IReadOnlyList Headers,
- string MimeType,
- long BytesReceived,
- long? HeadersSize,
- long? BodySize,
- ResponseContent Content)
+ string Protocol,
+ int Status, // TODO: should be unit
+ string StatusText,
+ bool FromCache,
+ IReadOnlyList Headers,
+ string MimeType,
+ long BytesReceived,
+ long? HeadersSize,
+ long? BodySize,
+ ResponseContent Content)
{
[JsonInclude]
public IReadOnlyList? AuthChallenges { get; internal set; }
diff --git a/dotnet/src/webdriver/BiDi/Modules/Network/ResponseStartedEventArgs.cs b/dotnet/src/webdriver/BiDi/Network/ResponseStartedEventArgs.cs
similarity index 75%
rename from dotnet/src/webdriver/BiDi/Modules/Network/ResponseStartedEventArgs.cs
rename to dotnet/src/webdriver/BiDi/Network/ResponseStartedEventArgs.cs
index 39d74946e56c2..71a3eeb573388 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Network/ResponseStartedEventArgs.cs
+++ b/dotnet/src/webdriver/BiDi/Network/ResponseStartedEventArgs.cs
@@ -17,10 +17,17 @@
// under the License.
//
-using OpenQA.Selenium.BiDi.Modules.BrowsingContext;
+using OpenQA.Selenium.BiDi.BrowsingContext;
using System;
-namespace OpenQA.Selenium.BiDi.Modules.Network;
+namespace OpenQA.Selenium.BiDi.Network;
-public record ResponseStartedEventArgs(BiDi BiDi, BrowsingContext.BrowsingContext Context, bool IsBlocked, Navigation Navigation, long RedirectCount, RequestData Request, DateTimeOffset Timestamp, ResponseData Response)
+public record ResponseStartedEventArgs(BiDi BiDi,
+ BrowsingContext.BrowsingContext? Context,
+ bool IsBlocked,
+ Navigation? Navigation,
+ long RedirectCount,
+ RequestData Request,
+ DateTimeOffset Timestamp,
+ ResponseData Response)
: BaseParametersEventArgs(BiDi, Context, IsBlocked, Navigation, RedirectCount, Request, Timestamp);
diff --git a/dotnet/src/webdriver/BiDi/Modules/Network/SetCacheBehaviorCommand.cs b/dotnet/src/webdriver/BiDi/Network/SetCacheBehaviorCommand.cs
similarity index 76%
rename from dotnet/src/webdriver/BiDi/Modules/Network/SetCacheBehaviorCommand.cs
rename to dotnet/src/webdriver/BiDi/Network/SetCacheBehaviorCommand.cs
index 7d49cc35a8947..15a96b235e4fa 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Network/SetCacheBehaviorCommand.cs
+++ b/dotnet/src/webdriver/BiDi/Network/SetCacheBehaviorCommand.cs
@@ -20,14 +20,14 @@
using System.Collections.Generic;
using OpenQA.Selenium.BiDi.Communication;
-namespace OpenQA.Selenium.BiDi.Modules.Network;
+namespace OpenQA.Selenium.BiDi.Network;
-internal class SetCacheBehaviorCommand(SetCacheBehaviorCommandParameters @params)
+internal sealed class SetCacheBehaviorCommand(SetCacheBehaviorCommandParameters @params)
: Command(@params, "network.setCacheBehavior");
-internal record SetCacheBehaviorCommandParameters(CacheBehavior CacheBehavior, IEnumerable? Contexts) : CommandParameters;
+internal sealed record SetCacheBehaviorCommandParameters(CacheBehavior CacheBehavior, IEnumerable? Contexts) : CommandParameters;
-public record SetCacheBehaviorOptions : CommandOptions
+public sealed class SetCacheBehaviorOptions : CommandOptions
{
public SetCacheBehaviorOptions()
{
@@ -42,10 +42,7 @@ internal SetCacheBehaviorOptions(BrowsingContextSetCacheBehaviorOptions? options
public IEnumerable? Contexts { get; set; }
}
-public record BrowsingContextSetCacheBehaviorOptions
-{
-
-}
+public sealed record BrowsingContextSetCacheBehaviorOptions;
public enum CacheBehavior
{
diff --git a/dotnet/src/webdriver/BiDi/Modules/Network/SetCookieHeader.cs b/dotnet/src/webdriver/BiDi/Network/SetCookieHeader.cs
similarity index 91%
rename from dotnet/src/webdriver/BiDi/Modules/Network/SetCookieHeader.cs
rename to dotnet/src/webdriver/BiDi/Network/SetCookieHeader.cs
index 5e42d4d54f93e..19d76a21248dc 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Network/SetCookieHeader.cs
+++ b/dotnet/src/webdriver/BiDi/Network/SetCookieHeader.cs
@@ -17,9 +17,9 @@
// under the License.
//
-namespace OpenQA.Selenium.BiDi.Modules.Network;
+namespace OpenQA.Selenium.BiDi.Network;
-public record SetCookieHeader(string Name, BytesValue Value)
+public sealed record SetCookieHeader(string Name, BytesValue Value)
{
public string? Domain { get; set; }
diff --git a/dotnet/src/webdriver/BiDi/Modules/Network/UrlPattern.cs b/dotnet/src/webdriver/BiDi/Network/UrlPattern.cs
similarity index 89%
rename from dotnet/src/webdriver/BiDi/Modules/Network/UrlPattern.cs
rename to dotnet/src/webdriver/BiDi/Network/UrlPattern.cs
index 29823516fcfe0..f77dff14ce9c2 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Network/UrlPattern.cs
+++ b/dotnet/src/webdriver/BiDi/Network/UrlPattern.cs
@@ -19,7 +19,7 @@
using System.Text.Json.Serialization;
-namespace OpenQA.Selenium.BiDi.Modules.Network;
+namespace OpenQA.Selenium.BiDi.Network;
[JsonPolymorphic(TypeDiscriminatorPropertyName = "type")]
[JsonDerivedType(typeof(PatternUrlPattern), "pattern")]
@@ -29,7 +29,7 @@ public abstract record UrlPattern
public static implicit operator UrlPattern(string value) => new StringUrlPattern(value);
}
-public record PatternUrlPattern : UrlPattern
+public sealed record PatternUrlPattern : UrlPattern
{
public string? Protocol { get; set; }
@@ -42,4 +42,4 @@ public record PatternUrlPattern : UrlPattern
public string? Search { get; set; }
}
-public record StringUrlPattern(string Pattern) : UrlPattern;
+public sealed record StringUrlPattern(string Pattern) : UrlPattern;
diff --git a/dotnet/src/webdriver/BiDi/Modules/Script/AddPreloadScriptCommand.cs b/dotnet/src/webdriver/BiDi/Script/AddPreloadScriptCommand.cs
similarity index 74%
rename from dotnet/src/webdriver/BiDi/Modules/Script/AddPreloadScriptCommand.cs
rename to dotnet/src/webdriver/BiDi/Script/AddPreloadScriptCommand.cs
index 68ddc27170de3..612301b4864ce 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Script/AddPreloadScriptCommand.cs
+++ b/dotnet/src/webdriver/BiDi/Script/AddPreloadScriptCommand.cs
@@ -20,14 +20,14 @@
using OpenQA.Selenium.BiDi.Communication;
using System.Collections.Generic;
-namespace OpenQA.Selenium.BiDi.Modules.Script;
+namespace OpenQA.Selenium.BiDi.Script;
-internal class AddPreloadScriptCommand(AddPreloadScriptCommandParameters @params)
+internal sealed class AddPreloadScriptCommand(AddPreloadScriptCommandParameters @params)
: Command(@params, "script.addPreloadScript");
-internal record AddPreloadScriptCommandParameters(string FunctionDeclaration, IEnumerable? Arguments, IEnumerable? Contexts, string? Sandbox) : CommandParameters;
+internal sealed record AddPreloadScriptCommandParameters(string FunctionDeclaration, IEnumerable? Arguments, IEnumerable? Contexts, string? Sandbox) : CommandParameters;
-public record AddPreloadScriptOptions : CommandOptions
+public sealed class AddPreloadScriptOptions : CommandOptions
{
public AddPreloadScriptOptions() { }
@@ -44,11 +44,11 @@ internal AddPreloadScriptOptions(BrowsingContextAddPreloadScriptOptions? options
public string? Sandbox { get; set; }
}
-public record BrowsingContextAddPreloadScriptOptions
+public sealed record BrowsingContextAddPreloadScriptOptions
{
public IEnumerable? Arguments { get; set; }
public string? Sandbox { get; set; }
}
-internal record AddPreloadScriptResult(PreloadScript Script) : EmptyResult;
+internal sealed record AddPreloadScriptResult(PreloadScript Script) : EmptyResult;
diff --git a/dotnet/src/webdriver/BiDi/Modules/Script/CallFunctionCommand.cs b/dotnet/src/webdriver/BiDi/Script/CallFunctionCommand.cs
similarity index 74%
rename from dotnet/src/webdriver/BiDi/Modules/Script/CallFunctionCommand.cs
rename to dotnet/src/webdriver/BiDi/Script/CallFunctionCommand.cs
index 7e460baff6547..7d8381296c53b 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Script/CallFunctionCommand.cs
+++ b/dotnet/src/webdriver/BiDi/Script/CallFunctionCommand.cs
@@ -20,14 +20,14 @@
using OpenQA.Selenium.BiDi.Communication;
using System.Collections.Generic;
-namespace OpenQA.Selenium.BiDi.Modules.Script;
+namespace OpenQA.Selenium.BiDi.Script;
-internal class CallFunctionCommand(CallFunctionCommandParameters @params)
+internal sealed class CallFunctionCommand(CallFunctionCommandParameters @params)
: Command(@params, "script.callFunction");
-internal record CallFunctionCommandParameters(string FunctionDeclaration, bool AwaitPromise, Target Target, IEnumerable? Arguments, ResultOwnership? ResultOwnership, SerializationOptions? SerializationOptions, LocalValue? This, bool? UserActivation) : CommandParameters;
+internal sealed record CallFunctionCommandParameters(string FunctionDeclaration, bool AwaitPromise, Target Target, IEnumerable? Arguments, ResultOwnership? ResultOwnership, SerializationOptions? SerializationOptions, LocalValue? This, bool? UserActivation) : CommandParameters;
-public record CallFunctionOptions : CommandOptions
+public sealed class CallFunctionOptions : CommandOptions
{
public IEnumerable? Arguments { get; set; }
diff --git a/dotnet/src/webdriver/BiDi/Modules/Script/Channel.cs b/dotnet/src/webdriver/BiDi/Script/Channel.cs
similarity index 91%
rename from dotnet/src/webdriver/BiDi/Modules/Script/Channel.cs
rename to dotnet/src/webdriver/BiDi/Script/Channel.cs
index 53856b51ad373..ea21ef212f3d3 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Script/Channel.cs
+++ b/dotnet/src/webdriver/BiDi/Script/Channel.cs
@@ -17,6 +17,6 @@
// under the License.
//
-namespace OpenQA.Selenium.BiDi.Modules.Script;
+namespace OpenQA.Selenium.BiDi.Script;
-public record Channel(string Id);
+public sealed record Channel(string Id);
diff --git a/dotnet/src/webdriver/BiDi/Modules/Script/ChannelProperties.cs b/dotnet/src/webdriver/BiDi/Script/ChannelProperties.cs
similarity index 91%
rename from dotnet/src/webdriver/BiDi/Modules/Script/ChannelProperties.cs
rename to dotnet/src/webdriver/BiDi/Script/ChannelProperties.cs
index 7cc884254f900..1001f0ba3f4ea 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Script/ChannelProperties.cs
+++ b/dotnet/src/webdriver/BiDi/Script/ChannelProperties.cs
@@ -17,9 +17,9 @@
// under the License.
//
-namespace OpenQA.Selenium.BiDi.Modules.Script;
+namespace OpenQA.Selenium.BiDi.Script;
-public record ChannelProperties(Channel Channel)
+public sealed record ChannelProperties(Channel Channel)
{
public SerializationOptions? SerializationOptions { get; set; }
diff --git a/dotnet/src/webdriver/BiDi/Modules/Script/DisownCommand.cs b/dotnet/src/webdriver/BiDi/Script/DisownCommand.cs
similarity index 82%
rename from dotnet/src/webdriver/BiDi/Modules/Script/DisownCommand.cs
rename to dotnet/src/webdriver/BiDi/Script/DisownCommand.cs
index 241b9f5e88048..abfa458329763 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Script/DisownCommand.cs
+++ b/dotnet/src/webdriver/BiDi/Script/DisownCommand.cs
@@ -20,9 +20,9 @@
using OpenQA.Selenium.BiDi.Communication;
using System.Collections.Generic;
-namespace OpenQA.Selenium.BiDi.Modules.Script;
+namespace OpenQA.Selenium.BiDi.Script;
-internal class DisownCommand(DisownCommandParameters @params)
+internal sealed class DisownCommand(DisownCommandParameters @params)
: Command(@params, "script.disown");
-internal record DisownCommandParameters(IEnumerable Handles, Target Target) : CommandParameters;
+internal sealed record DisownCommandParameters(IEnumerable Handles, Target Target) : CommandParameters;
diff --git a/dotnet/src/webdriver/BiDi/Modules/Script/EvaluateCommand.cs b/dotnet/src/webdriver/BiDi/Script/EvaluateCommand.cs
similarity index 72%
rename from dotnet/src/webdriver/BiDi/Modules/Script/EvaluateCommand.cs
rename to dotnet/src/webdriver/BiDi/Script/EvaluateCommand.cs
index 2812ba64e0e1c..cf9aecd75ceac 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Script/EvaluateCommand.cs
+++ b/dotnet/src/webdriver/BiDi/Script/EvaluateCommand.cs
@@ -20,14 +20,14 @@
using OpenQA.Selenium.BiDi.Communication;
using System;
-namespace OpenQA.Selenium.BiDi.Modules.Script;
+namespace OpenQA.Selenium.BiDi.Script;
-internal class EvaluateCommand(EvaluateCommandParameters @params)
+internal sealed class EvaluateCommand(EvaluateCommandParameters @params)
: Command(@params, "script.evaluate");
-internal record EvaluateCommandParameters(string Expression, Target Target, bool AwaitPromise, ResultOwnership? ResultOwnership, SerializationOptions? SerializationOptions, bool? UserActivation) : CommandParameters;
+internal sealed record EvaluateCommandParameters(string Expression, Target Target, bool AwaitPromise, ResultOwnership? ResultOwnership, SerializationOptions? SerializationOptions, bool? UserActivation) : CommandParameters;
-public record EvaluateOptions : CommandOptions
+public sealed class EvaluateOptions : CommandOptions
{
public ResultOwnership? ResultOwnership { get; set; }
@@ -53,11 +53,11 @@ public RemoteValue AsSuccessResult()
}
}
-public record EvaluateResultSuccess(RemoteValue Result, Realm Realm) : EvaluateResult
+public sealed record EvaluateResultSuccess(RemoteValue Result, Realm Realm) : EvaluateResult
{
public static implicit operator RemoteValue(EvaluateResultSuccess success) => success.Result;
}
-public record EvaluateResultException(ExceptionDetails ExceptionDetails, Realm Realm) : EvaluateResult;
+public sealed record EvaluateResultException(ExceptionDetails ExceptionDetails, Realm Realm) : EvaluateResult;
-public record ExceptionDetails(long ColumnNumber, long LineNumber, StackTrace StackTrace, string Text);
+public sealed record ExceptionDetails(long ColumnNumber, long LineNumber, StackTrace StackTrace, string Text);
diff --git a/dotnet/src/webdriver/BiDi/Modules/Script/GetRealmsCommand.cs b/dotnet/src/webdriver/BiDi/Script/GetRealmsCommand.cs
similarity index 81%
rename from dotnet/src/webdriver/BiDi/Modules/Script/GetRealmsCommand.cs
rename to dotnet/src/webdriver/BiDi/Script/GetRealmsCommand.cs
index 641602e4c6ee5..cc2b8d332f64c 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Script/GetRealmsCommand.cs
+++ b/dotnet/src/webdriver/BiDi/Script/GetRealmsCommand.cs
@@ -21,21 +21,21 @@
using System.Collections;
using System.Collections.Generic;
-namespace OpenQA.Selenium.BiDi.Modules.Script;
+namespace OpenQA.Selenium.BiDi.Script;
-internal class GetRealmsCommand(GetRealmsCommandParameters @params)
+internal sealed class GetRealmsCommand(GetRealmsCommandParameters @params)
: Command(@params, "script.getRealms");
-internal record GetRealmsCommandParameters(BrowsingContext.BrowsingContext? Context, RealmType? Type) : CommandParameters;
+internal sealed record GetRealmsCommandParameters(BrowsingContext.BrowsingContext? Context, RealmType? Type) : CommandParameters;
-public record GetRealmsOptions : CommandOptions
+public sealed class GetRealmsOptions : CommandOptions
{
public BrowsingContext.BrowsingContext? Context { get; set; }
public RealmType? Type { get; set; }
}
-public record GetRealmsResult : EmptyResult, IReadOnlyList
+public sealed record GetRealmsResult : EmptyResult, IReadOnlyList
{
private readonly IReadOnlyList _realms;
diff --git a/dotnet/src/webdriver/BiDi/Modules/Script/Handle.cs b/dotnet/src/webdriver/BiDi/Script/Handle.cs
similarity index 93%
rename from dotnet/src/webdriver/BiDi/Modules/Script/Handle.cs
rename to dotnet/src/webdriver/BiDi/Script/Handle.cs
index 87bf42439b82f..5b5e4f63ede08 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Script/Handle.cs
+++ b/dotnet/src/webdriver/BiDi/Script/Handle.cs
@@ -17,9 +17,9 @@
// under the License.
//
-namespace OpenQA.Selenium.BiDi.Modules.Script;
+namespace OpenQA.Selenium.BiDi.Script;
-public class Handle
+public sealed class Handle
{
private readonly BiDi _bidi;
diff --git a/dotnet/src/webdriver/BiDi/Modules/Script/IRemoteReference.cs b/dotnet/src/webdriver/BiDi/Script/IRemoteReference.cs
similarity index 96%
rename from dotnet/src/webdriver/BiDi/Modules/Script/IRemoteReference.cs
rename to dotnet/src/webdriver/BiDi/Script/IRemoteReference.cs
index 893ceb12549aa..6043612b58d9f 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Script/IRemoteReference.cs
+++ b/dotnet/src/webdriver/BiDi/Script/IRemoteReference.cs
@@ -17,7 +17,7 @@
// under the License.
//
-namespace OpenQA.Selenium.BiDi.Modules.Script;
+namespace OpenQA.Selenium.BiDi.Script;
public interface IRemoteReference;
diff --git a/dotnet/src/webdriver/BiDi/Modules/Script/InternalId.cs b/dotnet/src/webdriver/BiDi/Script/InternalId.cs
similarity index 93%
rename from dotnet/src/webdriver/BiDi/Modules/Script/InternalId.cs
rename to dotnet/src/webdriver/BiDi/Script/InternalId.cs
index 06550e0da98a7..2914c77c99a0c 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Script/InternalId.cs
+++ b/dotnet/src/webdriver/BiDi/Script/InternalId.cs
@@ -17,9 +17,9 @@
// under the License.
//
-namespace OpenQA.Selenium.BiDi.Modules.Script;
+namespace OpenQA.Selenium.BiDi.Script;
-public class InternalId
+public sealed class InternalId
{
readonly BiDi _bidi;
diff --git a/dotnet/src/webdriver/BiDi/Modules/Script/LocalValue.cs b/dotnet/src/webdriver/BiDi/Script/LocalValue.cs
similarity index 88%
rename from dotnet/src/webdriver/BiDi/Modules/Script/LocalValue.cs
rename to dotnet/src/webdriver/BiDi/Script/LocalValue.cs
index 0c66ec3c54862..7418bb3d09a0f 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Script/LocalValue.cs
+++ b/dotnet/src/webdriver/BiDi/Script/LocalValue.cs
@@ -25,7 +25,7 @@
using System.Text.Json.Serialization;
using System.Text.RegularExpressions;
-namespace OpenQA.Selenium.BiDi.Modules.Script;
+namespace OpenQA.Selenium.BiDi.Script;
[JsonPolymorphic(TypeDiscriminatorPropertyName = "type")]
[JsonDerivedType(typeof(NumberLocalValue), "number")]
@@ -282,36 +282,36 @@ private static LocalValue ReflectionBasedConvertFrom(object? value)
public abstract record PrimitiveProtocolLocalValue : LocalValue;
-public record NumberLocalValue(double Value) : PrimitiveProtocolLocalValue
+public sealed record NumberLocalValue(double Value) : PrimitiveProtocolLocalValue
{
public static explicit operator NumberLocalValue(double n) => new NumberLocalValue(n);
}
-public record StringLocalValue(string Value) : PrimitiveProtocolLocalValue;
+public sealed record StringLocalValue(string Value) : PrimitiveProtocolLocalValue;
-public record NullLocalValue : PrimitiveProtocolLocalValue;
+public sealed record NullLocalValue : PrimitiveProtocolLocalValue;
-public record UndefinedLocalValue : PrimitiveProtocolLocalValue;
+public sealed record UndefinedLocalValue : PrimitiveProtocolLocalValue;
-public record BooleanLocalValue(bool Value) : PrimitiveProtocolLocalValue;
+public sealed record BooleanLocalValue(bool Value) : PrimitiveProtocolLocalValue;
-public record BigIntLocalValue(string Value) : PrimitiveProtocolLocalValue;
+public sealed record BigIntLocalValue(string Value) : PrimitiveProtocolLocalValue;
-public record ChannelLocalValue(ChannelProperties Value) : LocalValue
+public sealed record ChannelLocalValue(ChannelProperties Value) : LocalValue
{
// AddPreloadScript takes arguments typed as ChannelLocalValue but still requires "type":"channel"
[JsonInclude]
internal string Type => "channel";
}
-public record ArrayLocalValue(IEnumerable Value) : LocalValue;
+public sealed record ArrayLocalValue(IEnumerable Value) : LocalValue;
-public record DateLocalValue(string Value) : LocalValue;
+public sealed record DateLocalValue(string Value) : LocalValue;
-public record MapLocalValue(IEnumerable> Value) : LocalValue;
+public sealed record MapLocalValue(IEnumerable> Value) : LocalValue;
-public record ObjectLocalValue(IEnumerable> Value) : LocalValue;
+public sealed record ObjectLocalValue(IEnumerable> Value) : LocalValue;
-public record RegExpLocalValue(RegExpValue Value) : LocalValue;
+public sealed record RegExpLocalValue(RegExpValue Value) : LocalValue;
-public record SetLocalValue(IEnumerable Value) : LocalValue;
+public sealed record SetLocalValue(IEnumerable Value) : LocalValue;
diff --git a/dotnet/src/webdriver/BiDi/Modules/Script/MessageEventArgs.cs b/dotnet/src/webdriver/BiDi/Script/MessageEventArgs.cs
similarity index 84%
rename from dotnet/src/webdriver/BiDi/Modules/Script/MessageEventArgs.cs
rename to dotnet/src/webdriver/BiDi/Script/MessageEventArgs.cs
index 11743c2ddd316..3bbf2ed939a23 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Script/MessageEventArgs.cs
+++ b/dotnet/src/webdriver/BiDi/Script/MessageEventArgs.cs
@@ -17,6 +17,6 @@
// under the License.
//
-namespace OpenQA.Selenium.BiDi.Modules.Script;
+namespace OpenQA.Selenium.BiDi.Script;
-public record MessageEventArgs(BiDi BiDi, Channel Channel, RemoteValue Data, Source Source) : EventArgs(BiDi);
+public sealed record MessageEventArgs(BiDi BiDi, Channel Channel, RemoteValue Data, Source Source) : EventArgs(BiDi);
diff --git a/dotnet/src/webdriver/BiDi/Modules/Script/NodeProperties.cs b/dotnet/src/webdriver/BiDi/Script/NodeProperties.cs
similarity index 93%
rename from dotnet/src/webdriver/BiDi/Modules/Script/NodeProperties.cs
rename to dotnet/src/webdriver/BiDi/Script/NodeProperties.cs
index 804580a7d2fd0..a63bf44def9a6 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Script/NodeProperties.cs
+++ b/dotnet/src/webdriver/BiDi/Script/NodeProperties.cs
@@ -20,9 +20,9 @@
using System.Collections.Generic;
using System.Text.Json.Serialization;
-namespace OpenQA.Selenium.BiDi.Modules.Script;
+namespace OpenQA.Selenium.BiDi.Script;
-public record NodeProperties(long NodeType, long ChildNodeCount)
+public sealed record NodeProperties(long NodeType, long ChildNodeCount)
{
[JsonInclude]
public IReadOnlyDictionary? Attributes { get; internal set; }
diff --git a/dotnet/src/webdriver/BiDi/Modules/Script/PreloadScript.cs b/dotnet/src/webdriver/BiDi/Script/PreloadScript.cs
similarity index 93%
rename from dotnet/src/webdriver/BiDi/Modules/Script/PreloadScript.cs
rename to dotnet/src/webdriver/BiDi/Script/PreloadScript.cs
index e48f1b7fa886f..428825305709c 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Script/PreloadScript.cs
+++ b/dotnet/src/webdriver/BiDi/Script/PreloadScript.cs
@@ -20,9 +20,9 @@
using System;
using System.Threading.Tasks;
-namespace OpenQA.Selenium.BiDi.Modules.Script;
+namespace OpenQA.Selenium.BiDi.Script;
-public class PreloadScript : IAsyncDisposable
+public sealed class PreloadScript : IAsyncDisposable
{
private readonly BiDi _bidi;
diff --git a/dotnet/src/webdriver/BiDi/Modules/Script/Realm.cs b/dotnet/src/webdriver/BiDi/Script/Realm.cs
similarity index 94%
rename from dotnet/src/webdriver/BiDi/Modules/Script/Realm.cs
rename to dotnet/src/webdriver/BiDi/Script/Realm.cs
index 7ecb553e2c798..b3fd6f776e0c7 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Script/Realm.cs
+++ b/dotnet/src/webdriver/BiDi/Script/Realm.cs
@@ -17,9 +17,9 @@
// under the License.
//
-namespace OpenQA.Selenium.BiDi.Modules.Script;
+namespace OpenQA.Selenium.BiDi.Script;
-public class Realm
+public sealed class Realm
{
private readonly BiDi _bidi;
diff --git a/dotnet/src/webdriver/BiDi/Modules/Script/RealmDestroyedEventArgs.cs b/dotnet/src/webdriver/BiDi/Script/RealmDestroyedEventArgs.cs
similarity index 87%
rename from dotnet/src/webdriver/BiDi/Modules/Script/RealmDestroyedEventArgs.cs
rename to dotnet/src/webdriver/BiDi/Script/RealmDestroyedEventArgs.cs
index 5c5c9434b0e76..74af338ffad42 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Script/RealmDestroyedEventArgs.cs
+++ b/dotnet/src/webdriver/BiDi/Script/RealmDestroyedEventArgs.cs
@@ -17,6 +17,6 @@
// under the License.
//
-namespace OpenQA.Selenium.BiDi.Modules.Script;
+namespace OpenQA.Selenium.BiDi.Script;
-public record RealmDestroyedEventArgs(BiDi BiDi, Realm Realm) : EventArgs(BiDi);
+public sealed record RealmDestroyedEventArgs(BiDi BiDi, Realm Realm) : EventArgs(BiDi);
diff --git a/dotnet/src/webdriver/BiDi/Modules/Script/RealmInfo.cs b/dotnet/src/webdriver/BiDi/Script/RealmInfo.cs
similarity index 63%
rename from dotnet/src/webdriver/BiDi/Modules/Script/RealmInfo.cs
rename to dotnet/src/webdriver/BiDi/Script/RealmInfo.cs
index ada89d999091c..84a97bee9ee2c 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Script/RealmInfo.cs
+++ b/dotnet/src/webdriver/BiDi/Script/RealmInfo.cs
@@ -19,7 +19,7 @@
using System.Collections.Generic;
-namespace OpenQA.Selenium.BiDi.Modules.Script;
+namespace OpenQA.Selenium.BiDi.Script;
// https://github.com/dotnet/runtime/issues/72604
//[JsonPolymorphic(TypeDiscriminatorPropertyName = "type")]
@@ -33,21 +33,21 @@ namespace OpenQA.Selenium.BiDi.Modules.Script;
//[JsonDerivedType(typeof(WorkletRealmInfo), "worklet")]
public abstract record RealmInfo(BiDi BiDi, Realm Realm, string Origin) : EventArgs(BiDi);
-public record WindowRealmInfo(BiDi BiDi, Realm Realm, string Origin, BrowsingContext.BrowsingContext Context) : RealmInfo(BiDi, Realm, Origin)
+public sealed record WindowRealmInfo(BiDi BiDi, Realm Realm, string Origin, BrowsingContext.BrowsingContext Context) : RealmInfo(BiDi, Realm, Origin)
{
public string? Sandbox { get; set; }
}
-public record DedicatedWorkerRealmInfo(BiDi BiDi, Realm Realm, string Origin, IReadOnlyList Owners) : RealmInfo(BiDi, Realm, Origin);
+public sealed record DedicatedWorkerRealmInfo(BiDi BiDi, Realm Realm, string Origin, IReadOnlyList Owners) : RealmInfo(BiDi, Realm, Origin);
-public record SharedWorkerRealmInfo(BiDi BiDi, Realm Realm, string Origin) : RealmInfo(BiDi, Realm, Origin);
+public sealed record SharedWorkerRealmInfo(BiDi BiDi, Realm Realm, string Origin) : RealmInfo(BiDi, Realm, Origin);
-public record ServiceWorkerRealmInfo(BiDi BiDi, Realm Realm, string Origin) : RealmInfo(BiDi, Realm, Origin);
+public sealed record ServiceWorkerRealmInfo(BiDi BiDi, Realm Realm, string Origin) : RealmInfo(BiDi, Realm, Origin);
-public record WorkerRealmInfo(BiDi BiDi, Realm Realm, string Origin) : RealmInfo(BiDi, Realm, Origin);
+public sealed record WorkerRealmInfo(BiDi BiDi, Realm Realm, string Origin) : RealmInfo(BiDi, Realm, Origin);
-public record PaintWorkletRealmInfo(BiDi BiDi, Realm Realm, string Origin) : RealmInfo(BiDi, Realm, Origin);
+public sealed record PaintWorkletRealmInfo(BiDi BiDi, Realm Realm, string Origin) : RealmInfo(BiDi, Realm, Origin);
-public record AudioWorkletRealmInfo(BiDi BiDi, Realm Realm, string Origin) : RealmInfo(BiDi, Realm, Origin);
+public sealed record AudioWorkletRealmInfo(BiDi BiDi, Realm Realm, string Origin) : RealmInfo(BiDi, Realm, Origin);
-public record WorkletRealmInfo(BiDi BiDi, Realm Realm, string Origin) : RealmInfo(BiDi, Realm, Origin);
+public sealed record WorkletRealmInfo(BiDi BiDi, Realm Realm, string Origin) : RealmInfo(BiDi, Realm, Origin);
diff --git a/dotnet/src/webdriver/BiDi/Modules/Script/RealmType.cs b/dotnet/src/webdriver/BiDi/Script/RealmType.cs
similarity index 95%
rename from dotnet/src/webdriver/BiDi/Modules/Script/RealmType.cs
rename to dotnet/src/webdriver/BiDi/Script/RealmType.cs
index 0958b42929edf..6dc81f1efcd3c 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Script/RealmType.cs
+++ b/dotnet/src/webdriver/BiDi/Script/RealmType.cs
@@ -17,7 +17,7 @@
// under the License.
//
-namespace OpenQA.Selenium.BiDi.Modules.Script;
+namespace OpenQA.Selenium.BiDi.Script;
public enum RealmType
{
diff --git a/dotnet/src/webdriver/BiDi/Modules/Script/RegExpValue.cs b/dotnet/src/webdriver/BiDi/Script/RegExpValue.cs
similarity index 96%
rename from dotnet/src/webdriver/BiDi/Modules/Script/RegExpValue.cs
rename to dotnet/src/webdriver/BiDi/Script/RegExpValue.cs
index eb25c091e8f91..c64c915582443 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Script/RegExpValue.cs
+++ b/dotnet/src/webdriver/BiDi/Script/RegExpValue.cs
@@ -21,9 +21,9 @@
using System.Diagnostics;
using System.Text.RegularExpressions;
-namespace OpenQA.Selenium.BiDi.Modules.Script;
+namespace OpenQA.Selenium.BiDi.Script;
-public record RegExpValue(string Pattern)
+public sealed record RegExpValue(string Pattern)
{
public string? Flags { get; set; }
diff --git a/dotnet/src/webdriver/BiDi/Modules/Script/RemoteValue.cs b/dotnet/src/webdriver/BiDi/Script/RemoteValue.cs
similarity index 79%
rename from dotnet/src/webdriver/BiDi/Modules/Script/RemoteValue.cs
rename to dotnet/src/webdriver/BiDi/Script/RemoteValue.cs
index af483e2bfbaab..80eaea6979116 100644
--- a/dotnet/src/webdriver/BiDi/Modules/Script/RemoteValue.cs
+++ b/dotnet/src/webdriver/BiDi/Script/RemoteValue.cs
@@ -23,7 +23,7 @@
using System.Text.Json;
using System.Text.Json.Serialization;
-namespace OpenQA.Selenium.BiDi.Modules.Script;
+namespace OpenQA.Selenium.BiDi.Script;
// https://github.com/dotnet/runtime/issues/72604
//[JsonPolymorphic(TypeDiscriminatorPropertyName = "type")]
@@ -97,26 +97,28 @@ public abstract record RemoteValue
}
}
-public record NumberRemoteValue(double Value) : PrimitiveProtocolRemoteValue;
+public abstract record PrimitiveProtocolRemoteValue : RemoteValue;
+
+public sealed record NumberRemoteValue(double Value) : PrimitiveProtocolRemoteValue;
-public record BooleanRemoteValue(bool Value) : PrimitiveProtocolRemoteValue;
+public sealed record BooleanRemoteValue(bool Value) : PrimitiveProtocolRemoteValue;
-public record BigIntRemoteValue(string Value) : PrimitiveProtocolRemoteValue;
+public sealed record BigIntRemoteValue(string Value) : PrimitiveProtocolRemoteValue;
-public record StringRemoteValue(string Value) : PrimitiveProtocolRemoteValue;
+public sealed record StringRemoteValue(string Value) : PrimitiveProtocolRemoteValue;
-public record NullRemoteValue : PrimitiveProtocolRemoteValue;
+public sealed record NullRemoteValue : PrimitiveProtocolRemoteValue;
-public record UndefinedRemoteValue : PrimitiveProtocolRemoteValue;
+public sealed record UndefinedRemoteValue : PrimitiveProtocolRemoteValue;
-public record SymbolRemoteValue : RemoteValue
+public sealed record SymbolRemoteValue : RemoteValue
{
public Handle? Handle { get; set; }
public InternalId? InternalId { get; set; }
}
-public record ArrayRemoteValue : RemoteValue
+public sealed record ArrayRemoteValue : RemoteValue
{
public Handle? Handle { get; set; }
@@ -125,7 +127,7 @@ public record ArrayRemoteValue : RemoteValue
public IReadOnlyList