From fe5e0cba55ba7943784d2b5c3c8ca118f9772536 Mon Sep 17 00:00:00 2001 From: Alex Rudenko Date: Fri, 12 Jan 2024 17:40:39 +0100 Subject: [PATCH 1/4] Require an explicit origin for WebDriver BiDi automation In WebDriver classic permissions apply to all enviroments that match the origin of the current environment. In WebDriver BiDi using the current view as an input for commands is not encouraged, therefore, this PR extends the WebDriver BiDi command with an explicit origin parameter. --- index.html | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index 9e28bb4..794554f 100644 --- a/index.html +++ b/index.html @@ -1232,14 +1232,15 @@

To set a permission given a {{PermissionDescriptor}} - |descriptor:PermissionDescriptor|, and a {{PermissionState}} |state:PermissionState|: + |descriptor:PermissionDescriptor|, a {{PermissionState}} |state:PermissionState|, and an + |origin|:

    -
  1. Let |settings| be the [=current settings object=]. +
  2. Let |target origin| be [=current settings object=]'s [=environment settings + object/origin=] if |origin| is null, or |origin| otherwise.
  3. Let |targets| be a list containing all [=environment settings objects=] whose - [=environment settings object/origin=] is [=same origin=] as the [=environment settings - object/origin=] of |settings|. + [=environment settings object/origin=] is [=same origin=] as |target origin|.
  4. Let |tasks| be an empty list.
  5. @@ -1323,8 +1324,8 @@

    descriptor type=]. If this throws an exception, return a [=invalid argument=] [=error=]. -
  6. [=Set a permission=] with |typedDescriptor| and - |parameters|.{{PermissionSetParameters/state}}. +
  7. [=Set a permission=] with |typedDescriptor|, + |parameters|.{{PermissionSetParameters/state}} and null.
  8. Return success with data `null`.
  9. @@ -1431,6 +1432,7 @@

    permissions.SetPermissionParameters = { descriptor: permissions.PermissionDescriptor, state: permissions.PermissionState, + origin: text, } @@ -1466,7 +1468,9 @@
    name|'s [=powerful feature/permission descriptor type=]. If this conversion throws an exception, return [=error=] with [=error code=] [=invalid argument=]. -
  10. [=Set a permission=] with |typedDescriptor| and |state|. +
  11. Let |origin| be the value of the `origin` field of |command parameters|. +
  12. +
  13. [=Set a permission=] with |typedDescriptor|, |state|, and |origin|.
  14. Return [=success=] with data `null`.
  15. From 3c097dd807f33e14e664fc0fc4165d1ff00f8f35 Mon Sep 17 00:00:00 2001 From: Alex Rudenko Date: Sat, 13 Jan 2024 09:13:00 +0100 Subject: [PATCH 2/4] Update index.html Co-authored-by: Mike Taylor --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 794554f..4fb0a24 100644 --- a/index.html +++ b/index.html @@ -1240,7 +1240,7 @@

    object/origin=] if |origin| is null, or |origin| otherwise.
  16. Let |targets| be a list containing all [=environment settings objects=] whose - [=environment settings object/origin=] is [=same origin=] as |target origin|. + [=environment settings object/origin=] is [=same origin=] with |target origin|.
  17. Let |tasks| be an empty list.
  18. From 0f7eb993f53db5cd09a6e14f99b2e02ad65baeab Mon Sep 17 00:00:00 2001 From: Alex Rudenko Date: Sat, 13 Jan 2024 09:14:16 +0100 Subject: [PATCH 3/4] Change to optional origin --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 4fb0a24..689ab74 100644 --- a/index.html +++ b/index.html @@ -1233,7 +1233,7 @@

    To set a permission given a {{PermissionDescriptor}} |descriptor:PermissionDescriptor|, a {{PermissionState}} |state:PermissionState|, and an - |origin|: + optional |origin|:

    1. Let |target origin| be [=current settings object=]'s [=environment settings @@ -1325,7 +1325,7 @@

      [=error=].

    2. [=Set a permission=] with |typedDescriptor|, - |parameters|.{{PermissionSetParameters/state}} and null. + |parameters|.{{PermissionSetParameters/state}}.
    3. Return success with data `null`.
    4. From 2118a064ea4af2362bef50fc1c05e7a94ece25a9 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Sun, 14 Jan 2024 09:48:22 -0500 Subject: [PATCH 4/4] Update index.html --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 689ab74..c521149 100644 --- a/index.html +++ b/index.html @@ -1324,7 +1324,7 @@

      descriptor type=]. If this throws an exception, return a [=invalid argument=] [=error=]. -
    5. [=Set a permission=] with |typedDescriptor|, +
    6. [=Set a permission=] with |typedDescriptor| and |parameters|.{{PermissionSetParameters/state}}.
    7. Return success with data `null`.