From 41826cb4c3915e0d8ed811471cb35d036c72cc66 Mon Sep 17 00:00:00 2001
From: Maksim Sadym
Date: Tue, 4 Nov 2025 13:20:57 +0100
Subject: [PATCH] [WebDriver BiDi] enable and disable scripting via BiDi
Based on https://github.com/whatwg/html/pull/11441. The bare minimal required changes.
---
source | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/source b/source
index 3a0d3fcc078..99b9f8e02f9 100644
--- a/source
+++ b/source
@@ -4697,6 +4697,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
WebDriver BiDi user prompt closed
WebDriver BiDi user prompt opened
WebDriver BiDi file dialog opened
+ WebDriver BiDi scripting is enabled
@@ -115945,6 +115946,9 @@ document.querySelector("button").addEventListener("click", bound);
associated Document's active
sandboxing flag set does not have its sandboxed scripts browsing context flag
set.
+
+ The result of WebDriver BiDi scripting is
+ enabled with settings is true.
@@ -117186,8 +117190,15 @@ document.querySelector("button").addEventListener("click", bound);
To create a classic script, given a
string source, an environment settings object
settings, a URL baseURL, a script fetch options
- options, an optional boolean mutedErrors (default false), and an optional
- URL-or-null sourceURLForWindowScripts (default null):
+ options, an optional boolean mutedErrors (default false), an optional
+ URL-or-null sourceURLForWindowScripts (default null) and an optional
+ boolean bypassDisabledScripting (default false):
+
+ The bypassDisabledScripting parameter is intended to be used for
+ running scripts even if scripting is disabled.
+ This is required for some automation scenarios, e.g. for WebDriver BiDi command "script.evaluate".
+
-
@@ -117201,7 +117212,8 @@ document.querySelector("button").addEventListener("click", bound);
If scripting is disabled for
- settings, then set source to the empty string.
+ settings and bypassDisabledScripting is false, then set
+ source to the empty string.
Let script be a new classic script that this algorithm will
subsequently initialize.