Skip to content

Commit cb35c13

Browse files
authored
Merge branch 'trunk' into java_webextension
2 parents 101b482 + 406427b commit cb35c13

File tree

44 files changed

+1676
-333
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1676
-333
lines changed

.github/workflows/ci-python.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Install dependencies
2828
run: |
2929
python -m pip install --upgrade pip
30-
pip install tox==4.25.0
30+
pip install tox==4.27.0
3131
- name: Generate docs
3232
run: tox -c py/tox.ini
3333
env:
@@ -47,7 +47,7 @@ jobs:
4747
- name: Install dependencies
4848
run: |
4949
python -m pip install --upgrade pip
50-
pip install tox==4.25.0
50+
pip install tox==4.27.0
5151
- name: Run type checking
5252
run: |
5353
tox -c py/tox.ini || true

common/repositories.bzl

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ js_library(
5050

5151
http_archive(
5252
name = "linux_beta_firefox",
53-
url = "https://ftp.mozilla.org/pub/firefox/releases/140.0b8/linux-x86_64/en-US/firefox-140.0b8.tar.xz",
54-
sha256 = "1fa8bcb1e242ffbad091b3ee7067ece582d34508db394e656832ab07b058e96e",
53+
url = "https://ftp.mozilla.org/pub/firefox/releases/140.0b9/linux-x86_64/en-US/firefox-140.0b9.tar.xz",
54+
sha256 = "812450fa61d36d44944fc9691a628b5c87d18268e68a15d9e54ac82ba4adfba5",
5555
build_file_content = """
5656
load("@aspect_rules_js//js:defs.bzl", "js_library")
5757
package(default_visibility = ["//visibility:public"])
@@ -72,8 +72,8 @@ js_library(
7272

7373
dmg_archive(
7474
name = "mac_beta_firefox",
75-
url = "https://ftp.mozilla.org/pub/firefox/releases/140.0b8/mac/en-US/Firefox%20140.0b8.dmg",
76-
sha256 = "7e648f5e0305a6abedb698ea5b29971cd1eb58225b998baa85a82d94bcf75342",
75+
url = "https://ftp.mozilla.org/pub/firefox/releases/140.0b9/mac/en-US/Firefox%20140.0b9.dmg",
76+
sha256 = "7c764a8210fe44797ba49982bede4d32235b33c7c996f4caffd15e5a06cf62a1",
7777
build_file_content = """
7878
load("@aspect_rules_js//js:defs.bzl", "js_library")
7979
package(default_visibility = ["//visibility:public"])
@@ -123,10 +123,10 @@ js_library(
123123

124124
pkg_archive(
125125
name = "mac_edge",
126-
url = "https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/881a4aef-792c-4d81-a76f-3cf546510d68/MicrosoftEdge-137.0.3296.68.pkg",
127-
sha256 = "4de62ee93ba67db666597807fc991e749f073af07a577dfdfc56dbf19409c87d",
126+
url = "https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/8146afbf-4969-4acb-baa7-a1b8a83745e5/MicrosoftEdge-137.0.3296.93.pkg",
127+
sha256 = "e098a79ceb0a843ff0d9331c86b27a49a6b26ba798f28d59a342ce8c2534f54b",
128128
move = {
129-
"MicrosoftEdge-137.0.3296.68.pkg/Payload/Microsoft Edge.app": "Edge.app",
129+
"MicrosoftEdge-137.0.3296.93.pkg/Payload/Microsoft Edge.app": "Edge.app",
130130
},
131131
build_file_content = """
132132
load("@aspect_rules_js//js:defs.bzl", "js_library")
@@ -143,8 +143,8 @@ js_library(
143143

144144
deb_archive(
145145
name = "linux_edge",
146-
url = "https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_137.0.3296.68-1_amd64.deb",
147-
sha256 = "76099017ace977c74060aa134a289d93c554e9d67f6561039580fdd483da0c41",
146+
url = "https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_137.0.3296.93-1_amd64.deb",
147+
sha256 = "482f21e9443f79ee5995058066c982d42a392b2e24697ba8329bd566d4c83074",
148148
build_file_content = """
149149
load("@aspect_rules_js//js:defs.bzl", "js_library")
150150
package(default_visibility = ["//visibility:public"])
@@ -165,8 +165,8 @@ js_library(
165165

166166
http_archive(
167167
name = "linux_edgedriver",
168-
url = "https://msedgedriver.azureedge.net/137.0.3296.68/edgedriver_linux64.zip",
169-
sha256 = "0605ae9e651befd470826ff3c3baf74b3d40599c25f1edd60b09d10f5b97144a",
168+
url = "https://msedgedriver.azureedge.net/137.0.3296.83/edgedriver_linux64.zip",
169+
sha256 = "141cd4cd42b7642dec1f215e0b1a0c1dae05f573218cb8ef18b876efa14f152a",
170170
build_file_content = """
171171
load("@aspect_rules_js//js:defs.bzl", "js_library")
172172
package(default_visibility = ["//visibility:public"])
@@ -182,8 +182,8 @@ js_library(
182182

183183
http_archive(
184184
name = "mac_edgedriver",
185-
url = "https://msedgedriver.azureedge.net/137.0.3296.68/edgedriver_mac64.zip",
186-
sha256 = "29b331d365361f0e9ef68c2e573f33ca895b3fa607823a66de9d6f226dbe4a54",
185+
url = "https://msedgedriver.azureedge.net/137.0.3296.83/edgedriver_mac64.zip",
186+
sha256 = "e361cfea041e649944a60a41ec40076be35fda8608e9011fad638ec0491a1f79",
187187
build_file_content = """
188188
load("@aspect_rules_js//js:defs.bzl", "js_library")
189189
package(default_visibility = ["//visibility:public"])
@@ -199,8 +199,8 @@ js_library(
199199

200200
http_archive(
201201
name = "linux_chrome",
202-
url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.70/linux64/chrome-linux64.zip",
203-
sha256 = "da1424d975dbe963b0a7f7f8e8c2e477bfed6b3430a2bc0b287f1c247ec62ee3",
202+
url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.119/linux64/chrome-linux64.zip",
203+
sha256 = "680a672ed0cc7b8fae6ee5b21691a55273228b05e1f3f80580606c4db203994a",
204204
build_file_content = """
205205
load("@aspect_rules_js//js:defs.bzl", "js_library")
206206
package(default_visibility = ["//visibility:public"])
@@ -220,8 +220,8 @@ js_library(
220220
)
221221
http_archive(
222222
name = "mac_chrome",
223-
url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.70/mac-x64/chrome-mac-x64.zip",
224-
sha256 = "2ea79a9457dbaffae6fbdf592c93776ac859dca98b448f7513cdd68234454a07",
223+
url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.119/mac-x64/chrome-mac-x64.zip",
224+
sha256 = "86d2e1cb317e78c4f5aefc70cf00e4fdaf9dcc80cf4ca3634abccf6d8781181e",
225225
strip_prefix = "chrome-mac-x64",
226226
patch_cmds = [
227227
"mv 'Google Chrome for Testing.app' Chrome.app",
@@ -241,8 +241,8 @@ js_library(
241241
)
242242
http_archive(
243243
name = "linux_chromedriver",
244-
url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.70/linux64/chromedriver-linux64.zip",
245-
sha256 = "cade69e8d67f4951049e56d796111755e0bf9240d26378975a95c8423bb3f55a",
244+
url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.119/linux64/chromedriver-linux64.zip",
245+
sha256 = "f4138b39e4fbe948e887ed5c1e0286c539fa81657cd5f2d8d51c1f68921a8880",
246246
strip_prefix = "chromedriver-linux64",
247247
build_file_content = """
248248
load("@aspect_rules_js//js:defs.bzl", "js_library")
@@ -259,8 +259,8 @@ js_library(
259259

260260
http_archive(
261261
name = "mac_chromedriver",
262-
url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.70/mac-x64/chromedriver-mac-x64.zip",
263-
sha256 = "d80825e87543d99ad7a8b9356fb236ddb7df3ba087f8f314991195da27a7ccc3",
262+
url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.119/mac-x64/chromedriver-mac-x64.zip",
263+
sha256 = "3502bec185bbb2732f21648d02ed3ac3c478ddfa35f3deddc9cc1433335309b7",
264264
strip_prefix = "chromedriver-mac-x64",
265265
build_file_content = """
266266
load("@aspect_rules_js//js:defs.bzl", "js_library")
@@ -277,8 +277,8 @@ js_library(
277277

278278
http_archive(
279279
name = "linux_beta_chrome",
280-
url = "https://storage.googleapis.com/chrome-for-testing-public/138.0.7204.15/linux64/chrome-linux64.zip",
281-
sha256 = "e4bb8769b613eacd7cc40e48f3f63d96de9e9ee642360b4a79bedd502291c544",
280+
url = "https://storage.googleapis.com/chrome-for-testing-public/138.0.7204.35/linux64/chrome-linux64.zip",
281+
sha256 = "4fd1afa4d0bb059114c1f244c09722d03aad151681adb40e09235ad9592d6e49",
282282
build_file_content = """
283283
load("@aspect_rules_js//js:defs.bzl", "js_library")
284284
package(default_visibility = ["//visibility:public"])
@@ -298,8 +298,8 @@ js_library(
298298
)
299299
http_archive(
300300
name = "mac_beta_chrome",
301-
url = "https://storage.googleapis.com/chrome-for-testing-public/138.0.7204.15/mac-x64/chrome-mac-x64.zip",
302-
sha256 = "46dbfe39930cd3a2a45bc85a70bb49c291c258fde5be4d3d4deecc8e3181ae2f",
301+
url = "https://storage.googleapis.com/chrome-for-testing-public/138.0.7204.35/mac-x64/chrome-mac-x64.zip",
302+
sha256 = "e312cd055c263120b75e6387a294458d340e57da332efca89f7afdc4541458b9",
303303
strip_prefix = "chrome-mac-x64",
304304
patch_cmds = [
305305
"mv 'Google Chrome for Testing.app' Chrome.app",
@@ -319,8 +319,8 @@ js_library(
319319
)
320320
http_archive(
321321
name = "linux_beta_chromedriver",
322-
url = "https://storage.googleapis.com/chrome-for-testing-public/138.0.7204.15/linux64/chromedriver-linux64.zip",
323-
sha256 = "b180e7569aa10a10e5b112b2b6cc21d126499122eaba0e90d264713285cc9104",
322+
url = "https://storage.googleapis.com/chrome-for-testing-public/138.0.7204.35/linux64/chromedriver-linux64.zip",
323+
sha256 = "eb423d4d1928fe03ad2414316c103607bf4624029f8fc115c54bcc4b1f613f0d",
324324
strip_prefix = "chromedriver-linux64",
325325
build_file_content = """
326326
load("@aspect_rules_js//js:defs.bzl", "js_library")
@@ -337,8 +337,8 @@ js_library(
337337

338338
http_archive(
339339
name = "mac_beta_chromedriver",
340-
url = "https://storage.googleapis.com/chrome-for-testing-public/138.0.7204.15/mac-x64/chromedriver-mac-x64.zip",
341-
sha256 = "fda50dbab46115e2185cae0f3eeb8526c3f95175b0d4f7f7871aaf1e63590d5c",
340+
url = "https://storage.googleapis.com/chrome-for-testing-public/138.0.7204.35/mac-x64/chromedriver-mac-x64.zip",
341+
sha256 = "b9863dc8e00469b5eb74be7472653694c9fd6943e3e47ec9e1b00c93c9fb68a6",
342342
strip_prefix = "chromedriver-mac-x64",
343343
build_file_content = """
344344
load("@aspect_rules_js//js:defs.bzl", "js_library")

dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContext.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,16 @@ public Task<Subscription> OnFragmentNavigatedAsync(Action<NavigationInfo> handle
147147
return BiDi.BrowsingContext.OnFragmentNavigatedAsync(handler, new BrowsingContextsSubscriptionOptions(options) { Contexts = [this] });
148148
}
149149

150+
public Task<Subscription> OnHistoryUpdatedAsync(Func<HistoryUpdatedEventArgs, Task> handler, SubscriptionOptions? options = null)
151+
{
152+
return BiDi.BrowsingContext.OnHistoryUpdatedAsync(handler, new BrowsingContextsSubscriptionOptions(options) { Contexts = [this] });
153+
}
154+
155+
public Task<Subscription> OnHistoryUpdatedAsync(Action<HistoryUpdatedEventArgs> handler, SubscriptionOptions? options = null)
156+
{
157+
return BiDi.BrowsingContext.OnHistoryUpdatedAsync(handler, new BrowsingContextsSubscriptionOptions(options) { Contexts = [this] });
158+
}
159+
150160
public Task<Subscription> OnDomContentLoadedAsync(Func<NavigationInfo, Task> handler, SubscriptionOptions? options = null)
151161
{
152162
return BiDi.BrowsingContext.OnDomContentLoadedAsync(handler, new BrowsingContextsSubscriptionOptions(options) { Contexts = [this] });

dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContextModule.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,16 @@ public async Task<Subscription> OnFragmentNavigatedAsync(Action<NavigationInfo>
134134
return await Broker.SubscribeAsync("browsingContext.fragmentNavigated", handler, options).ConfigureAwait(false);
135135
}
136136

137+
public async Task<Subscription> OnHistoryUpdatedAsync(Func<HistoryUpdatedEventArgs, Task> handler, BrowsingContextsSubscriptionOptions? options = null)
138+
{
139+
return await Broker.SubscribeAsync("browsingContext.historyUpdated", handler, options).ConfigureAwait(false);
140+
}
141+
142+
public async Task<Subscription> OnHistoryUpdatedAsync(Action<HistoryUpdatedEventArgs> handler, BrowsingContextsSubscriptionOptions? options = null)
143+
{
144+
return await Broker.SubscribeAsync("browsingContext.historyUpdated", handler, options).ConfigureAwait(false);
145+
}
146+
137147
public async Task<Subscription> OnDomContentLoadedAsync(Func<NavigationInfo, Task> handler, BrowsingContextsSubscriptionOptions? options = null)
138148
{
139149
return await Broker.SubscribeAsync("browsingContext.domContentLoaded", handler, options).ConfigureAwait(false);

dotnet/src/webdriver/BiDi/BrowsingContext/CaptureScreenshotCommand.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,7 @@ public record ElementClipRectangle(Script.ISharedReference Element) : ClipRectan
5858

5959
public record CaptureScreenshotResult(string Data) : EmptyResult
6060
{
61+
public static implicit operator byte[](CaptureScreenshotResult captureScreenshotResult) => captureScreenshotResult.ToByteArray();
62+
6163
public byte[] ToByteArray() => System.Convert.FromBase64String(Data);
6264
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// <copyright file="HistoryUpdatedEventArgs.cs" company="Selenium Committers">
2+
// Licensed to the Software Freedom Conservancy (SFC) under one
3+
// or more contributor license agreements. See the NOTICE file
4+
// distributed with this work for additional information
5+
// regarding copyright ownership. The SFC licenses this file
6+
// to you under the Apache License, Version 2.0 (the
7+
// "License"); you may not use this file except in compliance
8+
// with the License. You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing,
13+
// software distributed under the License is distributed on an
14+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
// KIND, either express or implied. See the License for the
16+
// specific language governing permissions and limitations
17+
// under the License.
18+
// </copyright>
19+
20+
using System;
21+
22+
namespace OpenQA.Selenium.BiDi.BrowsingContext;
23+
24+
public record HistoryUpdatedEventArgs(BiDi BiDi, BrowsingContext Context, DateTimeOffset Timestamp, string Url)
25+
: BrowsingContextEventArgs(BiDi, Context);

dotnet/src/webdriver/BiDi/Communication/Json/BiDiJsonSerializerContext.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,10 @@ namespace OpenQA.Selenium.BiDi.Communication.Json;
111111
[JsonSerializable(typeof(BrowsingContext.SetViewportCommand))]
112112
[JsonSerializable(typeof(BrowsingContext.TraverseHistoryCommand))]
113113
[JsonSerializable(typeof(BrowsingContext.TraverseHistoryResult))]
114+
114115
[JsonSerializable(typeof(BrowsingContext.BrowsingContextInfo))]
116+
[JsonSerializable(typeof(BrowsingContext.HistoryUpdatedEventArgs))]
115117
[JsonSerializable(typeof(BrowsingContext.NavigationInfo))]
116-
117118
[JsonSerializable(typeof(BrowsingContext.UserPromptOpenedEventArgs))]
118119
[JsonSerializable(typeof(BrowsingContext.UserPromptClosedEventArgs))]
119120

dotnet/src/webdriver/BiDi/Session/ProxyConfiguration.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
// under the License.
1818
// </copyright>
1919

20+
using System.Collections.Generic;
2021
using System.Text.Json.Serialization;
2122

2223
namespace OpenQA.Selenium.BiDi.Session;
@@ -33,19 +34,26 @@ public record AutoDetectProxyConfiguration : ProxyConfiguration;
3334

3435
public record DirectProxyConfiguration : ProxyConfiguration;
3536

36-
public record ManualProxyConfiguration : ProxyConfiguration
37+
public record ManualProxyConfiguration : ProxyConfiguration, ISocksProxyConfiguration
3738
{
38-
public string? FtpProxy { get; set; }
39-
4039
public string? HttpProxy { get; set; }
4140

4241
public string? SslProxy { get; set; }
4342

4443
public string? SocksProxy { get; set; }
4544

46-
public long? SocksVersion { get; set; }
45+
public int? SocksVersion { get; set; }
46+
47+
public IEnumerable<string>? NoProxy { get; set; }
4748
}
4849

4950
public record PacProxyConfiguration(string ProxyAutoConfigUrl) : ProxyConfiguration;
5051

5152
public record SystemProxyConfiguration : ProxyConfiguration;
53+
54+
public interface ISocksProxyConfiguration
55+
{
56+
public string? SocksProxy { get; set; }
57+
58+
public int? SocksVersion { get; set; } // 0..255
59+
}

java/src/org/openqa/selenium/Proxy.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public String toString() {
6767
}
6868

6969
private static final String PROXY_TYPE = "proxyType";
70-
private static final String FTP_PROXY = "ftpProxy";
70+
@Deprecated private static final String FTP_PROXY = "ftpProxy";
7171
private static final String HTTP_PROXY = "httpProxy";
7272
private static final String NO_PROXY = "noProxy";
7373
private static final String SSL_PROXY = "sslProxy";
@@ -80,7 +80,7 @@ public String toString() {
8080

8181
private ProxyType proxyType = ProxyType.UNSPECIFIED;
8282
private boolean autodetect = false;
83-
private @Nullable String ftpProxy;
83+
@Deprecated private @Nullable String ftpProxy;
8484
private @Nullable String httpProxy;
8585
private @Nullable String noProxy;
8686
private @Nullable String sslProxy;
@@ -225,7 +225,9 @@ public Proxy setAutodetect(boolean autodetect) {
225225
* Gets the FTP proxy.
226226
*
227227
* @return the FTP proxy hostname if present, or null if not set
228+
* @deprecated getFtpProxy is deprecated and will be removed in a future release.
228229
*/
230+
@Deprecated
229231
public @Nullable String getFtpProxy() {
230232
return ftpProxy;
231233
}
@@ -235,7 +237,9 @@ public Proxy setAutodetect(boolean autodetect) {
235237
*
236238
* @param ftpProxy the proxy host, expected format is <code>hostname.com:1234</code>
237239
* @return reference to self
240+
* @deprecated setFtpProxy is deprecated and will be removed in a future release.
238241
*/
242+
@Deprecated
239243
public Proxy setFtpProxy(String ftpProxy) {
240244
verifyProxyTypeCompatibility(ProxyType.MANUAL);
241245
this.proxyType = ProxyType.MANUAL;

java/src/org/openqa/selenium/grid/commands/Hub.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import java.net.MalformedURLException;
3232
import java.net.URL;
3333
import java.util.Collections;
34+
import java.util.List;
3435
import java.util.Set;
3536
import java.util.logging.Level;
3637
import java.util.logging.Logger;
@@ -48,6 +49,8 @@
4849
import org.openqa.selenium.grid.log.LoggingOptions;
4950
import org.openqa.selenium.grid.router.ProxyWebsocketsIntoGrid;
5051
import org.openqa.selenium.grid.router.Router;
52+
import org.openqa.selenium.grid.router.httpd.BlockedRoute;
53+
import org.openqa.selenium.grid.router.httpd.BlockedRoutesFilter;
5154
import org.openqa.selenium.grid.router.httpd.RouterOptions;
5255
import org.openqa.selenium.grid.security.BasicAuthenticationFilter;
5356
import org.openqa.selenium.grid.security.Secret;
@@ -207,6 +210,13 @@ protected Handlers createHandlers(Config config) {
207210
httpHandler = httpHandler.with(new BasicAuthenticationFilter(uap.username(), uap.password()));
208211
}
209212

213+
// Apply blocked routes filter
214+
List<BlockedRoute> blockedRoutes = routerOptions.getBlockedRoutes();
215+
if (!blockedRoutes.isEmpty()) {
216+
LOG.info("Blocking " + blockedRoutes.size() + " route(s): " + blockedRoutes);
217+
httpHandler = BlockedRoutesFilter.with(httpHandler, blockedRoutes);
218+
}
219+
210220
// Allow the liveness endpoint to be reached, since k8s doesn't make it easy to authenticate
211221
// these checks
212222
httpHandler = combine(httpHandler, Route.get("/readyz").to(() -> readinessCheck));

0 commit comments

Comments
 (0)