Conversation
embeddingOrigin to the permissions.setPermission commandtopLevelOrigin to the permissions.setPermission command
topLevelOrigin to the permissions.setPermission commandtopLevelOrigin parameter to the permissions.setPermission command
cfredric
left a comment
There was a problem hiding this comment.
I think this looks pretty good now, thanks!
| <li>Let |origin| be the value of the `origin` field of |command parameters|. | ||
| </li> | ||
| <li>Let |embedding origin| be the value of the `embeddingOrigin` field of | ||
| <li>Let |top level origin| be the value of the `topLevelOrigin` field of |
There was a problem hiding this comment.
It occurs to me that there's a type mismatch here - top level origin is defined to be a text value here, but later on we use it as if it were an [=origin=] (without parsing it or anything). This is an existing problem with how the spec handles the origin variable, too. Technically, the spec probably ought to run a URL parser on the text to produce a URL and then access the URL's origin. Maybe there's a shorthand for doing all of that?
Co-authored-by: Chris Fredrickson <cfredric@users.noreply.github.com>
|
Hey thanks! A few questions/comments while I try to page this all back into my head. Dumb question: why not just add an additional optional top-level origin argument into "set a permission" and plumb that in?
I don't follow here - in https://pr-preview.s3.amazonaws.com/w3c/permissions/468/4f2ccb0...jalonthomas:4841693.html#automation you're calling the permission key generation algorithm with a current settings object. So why do we need to modify the permission key generation algorithm? When does WebDriver have a CSO (which is a type of ESO) but not an ESO? |
My understanding is that WebDriver doesn’t have an ESO at all. By modifying the permission key generation algorithm to take an origin and a top-level origin directly, it's now possible for WebDriver to call the algorithm and set permissions without needing an ESO..
This is definitely a possibility, but the optional origin before functionally was the key. So rather than pass both origins, I think it makes sense to consolidate under a single permission key input, and have the callers generate that key themselves. |
Those steps happen on the browser side, so it should have access to all ESOs. WebDriver only sends the command to the browser. |
Right so the only change that we're realistically making is adding an optional topLevelOrigin to SetPermissionParameters here. That's the input to the link that you sent. We'll then parse that value as well and send it using Broser.setPermission. |
|
My feeling here is that we should just add the argument to the setPermission command and not do any additional refactoring (the fact that WebDriver/BiDi does or does not have an ESO at various parts of the algorithm it consumes feels like an implementation detail for WebDriver to worry about). But, maybe I wrong and happy to convinced otherwise. Curious if @marcoscaceres has any thoughts here. |
|
Yeah, I'm reaching the same conclusion as @miketaylr. The fact that we can set permissions at all via Web Driver implies that there is an ESO in Web Driver. In all cases, we should be passing both the origin and top level origin regardless... if we can pass the origin already. |
|
If I may chime in - the issue that Jalon's trying to fix is that step 2 of The usage of This means it's no longer possible for WebDriver to precisely override the permissions states for permissions whose key type is not the default, i.e. aren't origins. For example, WebDriver cannot request that the Jalon's PR is meant to fix this by allowing WebDriver This is why the PR modifies the key generation algorithm: so that the WebDriver (Side note -- I don't really understand step 4.1 of |
|
I met with @cfredric and @jalonthomas to discuss the PR again. My initial preference would be to keep changes local for the WebDriver BiDi changes, and saw the other changes as ~refactoring. But also, this change looks good and will make it possible to test the "storage access" permission, which is currently untestable via WebDriver bidi. |
The specification says to use the current settings object's origin and top-level origin, as of w3c/permissions#468 (the parameter was renamed in w3c/permissions#469). Note that this change should be a no-op for all permission types *except* for `storage-access`, since `storage-access` is the only permission type whose "permission key" is not the context's top-level origin. This is why only the storage-access-api WPTs are affected. (This CL fixes a bug where PermissionOverrides used the wrong origin for non-storage-access permissions. This bug was hidden by https://crsrc.org/c/content/browser/devtools/protocol/browser_handler.cc;drc=3e7f5adf9807d7eeb6fc72fa58e9fc4c3451f407;l=437 until now, since chromedriver did not supply the embeddedOrigin until this CL.) Skipping flake verification since this looks like an existing bug (maybe https://crbug.com/40096995). Bug: 384959114 Validate-Test-Flakiness: skip Change-Id: I07b59ca281bc4a4a56a37fc313b4d606233c8a60 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7093216 Reviewed-by: Alex N. Jose <alexnj@chromium.org> Auto-Submit: Chris Fredrickson <cfredric@chromium.org> Commit-Queue: Chris Fredrickson <cfredric@chromium.org> Reviewed-by: Elias Klim <elklm@chromium.org> Cr-Commit-Position: refs/heads/main@{#1538255}
The specification says to use the current settings object's origin and top-level origin, as of w3c/permissions#468 (the parameter was renamed in w3c/permissions#469). Note that this change should be a no-op for all permission types *except* for `storage-access`, since `storage-access` is the only permission type whose "permission key" is not the context's top-level origin. This is why only the storage-access-api WPTs are affected. (This CL fixes a bug where PermissionOverrides used the wrong origin for non-storage-access permissions. This bug was hidden by https://crsrc.org/c/content/browser/devtools/protocol/browser_handler.cc;drc=3e7f5adf9807d7eeb6fc72fa58e9fc4c3451f407;l=437 until now, since chromedriver did not supply the embeddedOrigin until this CL.) Skipping flake verification since this looks like an existing bug (maybe https://crbug.com/40096995). Bug: 384959114 Validate-Test-Flakiness: skip Change-Id: I07b59ca281bc4a4a56a37fc313b4d606233c8a60 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7093216 Reviewed-by: Alex N. Jose <alexnj@chromium.org> Auto-Submit: Chris Fredrickson <cfredric@chromium.org> Commit-Queue: Chris Fredrickson <cfredric@chromium.org> Reviewed-by: Elias Klim <elklm@chromium.org> Cr-Commit-Position: refs/heads/main@{#1538255}
…ame's URL" This reverts commit 694c3f3. Reason for revert: https://ci.chromium.org/ui/p/chromium/builders/ci/linux-blink-msan-rel/2563/overview starts to fail on linux-blink-msan-rel (https://ci.chromium.org/ui/b/8699543305082222881) Original change's description: > Update chromedriver's SetPermission command to use current frame's URL > > The specification says to use the current settings object's origin and > top-level origin, as of w3c/permissions#468 (the > parameter was renamed in w3c/permissions#469). > > Note that this change should be a no-op for all permission types > *except* for `storage-access`, since `storage-access` is the only > permission type whose "permission key" is not the context's top-level > origin. This is why only the storage-access-api WPTs are affected. > > (This CL fixes a bug where PermissionOverrides used the wrong origin for > non-storage-access permissions. This bug was hidden by > https://crsrc.org/c/content/browser/devtools/protocol/browser_handler.cc;drc=3e7f5adf9807d7eeb6fc72fa58e9fc4c3451f407;l=437 > until now, since chromedriver did not supply the embeddedOrigin until > this CL.) > > Skipping flake verification since this looks like an existing bug (maybe > https://crbug.com/40096995). > > Bug: 384959114 > Validate-Test-Flakiness: skip > Change-Id: I07b59ca281bc4a4a56a37fc313b4d606233c8a60 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7093216 > Reviewed-by: Alex N. Jose <alexnj@chromium.org> > Auto-Submit: Chris Fredrickson <cfredric@chromium.org> > Commit-Queue: Chris Fredrickson <cfredric@chromium.org> > Reviewed-by: Elias Klim <elklm@chromium.org> > Cr-Commit-Position: refs/heads/main@{#1538255} Bug: 384959114, 414530752 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 384959114 Change-Id: I0d28ccd5c49aec302d3b84db6027cf0a7d1dcb68 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7104484 Commit-Queue: Taiyo Mizuhashi <taiyo@chromium.org> Owners-Override: Taiyo Mizuhashi <taiyo@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Cr-Commit-Position: refs/heads/main@{#1538397}
…ame's URL" This reverts commit 6d49173. Reason for revert: https://ci.chromium.org/ui/p/chromium/builders/ci/linux-blink-msan-rel/2563/overview starts to fail on linux-blink-msan-rel (https://ci.chromium.org/ui/b/8699543305082222881) Original change's description: > Update chromedriver's SetPermission command to use current frame's URL > > The specification says to use the current settings object's origin and > top-level origin, as of w3c/permissions#468 (the > parameter was renamed in w3c/permissions#469). > > Note that this change should be a no-op for all permission types > *except* for `storage-access`, since `storage-access` is the only > permission type whose "permission key" is not the context's top-level > origin. This is why only the storage-access-api WPTs are affected. > > (This CL fixes a bug where PermissionOverrides used the wrong origin for > non-storage-access permissions. This bug was hidden by > https://crsrc.org/c/content/browser/devtools/protocol/browser_handler.cc;drc=3e7f5adf9807d7eeb6fc72fa58e9fc4c3451f407;l=437 > until now, since chromedriver did not supply the embeddedOrigin until > this CL.) > > Skipping flake verification since this looks like an existing bug (maybe > https://crbug.com/40096995). > > Bug: 384959114 > Validate-Test-Flakiness: skip > Change-Id: I07b59ca281bc4a4a56a37fc313b4d606233c8a60 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7093216 > Reviewed-by: Alex N. Jose <alexnj@chromium.org> > Auto-Submit: Chris Fredrickson <cfredric@chromium.org> > Commit-Queue: Chris Fredrickson <cfredric@chromium.org> > Reviewed-by: Elias Klim <elklm@chromium.org> > Cr-Commit-Position: refs/heads/main@{#1538255} Bug: 384959114, 414530752 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 384959114 Change-Id: I0d28ccd5c49aec302d3b84db6027cf0a7d1dcb68 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7104484 Commit-Queue: Taiyo Mizuhashi <taiyo@chromium.org> Owners-Override: Taiyo Mizuhashi <taiyo@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Cr-Commit-Position: refs/heads/main@{#1538397}
…ame's URL" This is a reland of commit 694c3f3 This version is a bit more careful with TestExpectations, and doesn't remove entries that might still timeout on slower bots (e.g. msan/asan/etc). Original change's description: > Update chromedriver's SetPermission command to use current frame's URL > > The specification says to use the current settings object's origin and > top-level origin, as of w3c/permissions#468 (the > parameter was renamed in w3c/permissions#469). > > Note that this change should be a no-op for all permission types > *except* for `storage-access`, since `storage-access` is the only > permission type whose "permission key" is not the context's top-level > origin. This is why only the storage-access-api WPTs are affected. > > (This CL fixes a bug where PermissionOverrides used the wrong origin for > non-storage-access permissions. This bug was hidden by > https://crsrc.org/c/content/browser/devtools/protocol/browser_handler.cc;drc=3e7f5adf9807d7eeb6fc72fa58e9fc4c3451f407;l=437 > until now, since chromedriver did not supply the embeddedOrigin until > this CL.) > > Skipping flake verification since this looks like an existing bug (maybe > https://crbug.com/40096995). > > Bug: 384959114 > Validate-Test-Flakiness: skip > Change-Id: I07b59ca281bc4a4a56a37fc313b4d606233c8a60 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7093216 > Reviewed-by: Alex N. Jose <alexnj@chromium.org> > Auto-Submit: Chris Fredrickson <cfredric@chromium.org> > Commit-Queue: Chris Fredrickson <cfredric@chromium.org> > Reviewed-by: Elias Klim <elklm@chromium.org> > Cr-Commit-Position: refs/heads/main@{#1538255} Bug: 384959114 Change-Id: Ibe4d28ad5c6359ea0ae43fb00831a4b7824dd89f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7106801 Reviewed-by: Alex N. Jose <alexnj@chromium.org> Commit-Queue: Chris Fredrickson <cfredric@chromium.org> Auto-Submit: Chris Fredrickson <cfredric@chromium.org> Reviewed-by: Elias Klim <elklm@chromium.org> Cr-Commit-Position: refs/heads/main@{#1539450}
…ame's URL" This is a reland of commit 6d49173 This version is a bit more careful with TestExpectations, and doesn't remove entries that might still timeout on slower bots (e.g. msan/asan/etc). Original change's description: > Update chromedriver's SetPermission command to use current frame's URL > > The specification says to use the current settings object's origin and > top-level origin, as of w3c/permissions#468 (the > parameter was renamed in w3c/permissions#469). > > Note that this change should be a no-op for all permission types > *except* for `storage-access`, since `storage-access` is the only > permission type whose "permission key" is not the context's top-level > origin. This is why only the storage-access-api WPTs are affected. > > (This CL fixes a bug where PermissionOverrides used the wrong origin for > non-storage-access permissions. This bug was hidden by > https://crsrc.org/c/content/browser/devtools/protocol/browser_handler.cc;drc=3e7f5adf9807d7eeb6fc72fa58e9fc4c3451f407;l=437 > until now, since chromedriver did not supply the embeddedOrigin until > this CL.) > > Skipping flake verification since this looks like an existing bug (maybe > https://crbug.com/40096995). > > Bug: 384959114 > Validate-Test-Flakiness: skip > Change-Id: I07b59ca281bc4a4a56a37fc313b4d606233c8a60 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7093216 > Reviewed-by: Alex N. Jose <alexnj@chromium.org> > Auto-Submit: Chris Fredrickson <cfredric@chromium.org> > Commit-Queue: Chris Fredrickson <cfredric@chromium.org> > Reviewed-by: Elias Klim <elklm@chromium.org> > Cr-Commit-Position: refs/heads/main@{#1538255} Bug: 384959114 Change-Id: Ibe4d28ad5c6359ea0ae43fb00831a4b7824dd89f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7106801 Reviewed-by: Alex N. Jose <alexnj@chromium.org> Commit-Queue: Chris Fredrickson <cfredric@chromium.org> Auto-Submit: Chris Fredrickson <cfredric@chromium.org> Reviewed-by: Elias Klim <elklm@chromium.org> Cr-Commit-Position: refs/heads/main@{#1539450}
The specification says to use the current settings object's origin and top-level origin, as of w3c/permissions#468 (the parameter was renamed in w3c/permissions#469). Note that this change should be a no-op for all permission types *except* for `storage-access`, since `storage-access` is the only permission type whose "permission key" is not the context's top-level origin. This is why only the storage-access-api WPTs are affected. (This CL fixes a bug where PermissionOverrides used the wrong origin for non-storage-access permissions. This bug was hidden by https://crsrc.org/c/content/browser/devtools/protocol/browser_handler.cc;drc=3e7f5adf9807d7eeb6fc72fa58e9fc4c3451f407;l=437 until now, since chromedriver did not supply the embeddedOrigin until this CL.) Skipping flake verification since this looks like an existing bug (maybe https://crbug.com/40096995). Bug: 384959114 Validate-Test-Flakiness: skip Change-Id: I07b59ca281bc4a4a56a37fc313b4d606233c8a60 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7093216 Reviewed-by: Alex N. Jose <alexnj@chromium.org> Auto-Submit: Chris Fredrickson <cfredric@chromium.org> Commit-Queue: Chris Fredrickson <cfredric@chromium.org> Reviewed-by: Elias Klim <elklm@chromium.org> Cr-Commit-Position: refs/heads/main@{#1538255}
…ame's URL" This reverts commit 694c3f3. Reason for revert: https://ci.chromium.org/ui/p/chromium/builders/ci/linux-blink-msan-rel/2563/overview starts to fail on linux-blink-msan-rel (https://ci.chromium.org/ui/b/8699543305082222881) Original change's description: > Update chromedriver's SetPermission command to use current frame's URL > > The specification says to use the current settings object's origin and > top-level origin, as of w3c/permissions#468 (the > parameter was renamed in w3c/permissions#469). > > Note that this change should be a no-op for all permission types > *except* for `storage-access`, since `storage-access` is the only > permission type whose "permission key" is not the context's top-level > origin. This is why only the storage-access-api WPTs are affected. > > (This CL fixes a bug where PermissionOverrides used the wrong origin for > non-storage-access permissions. This bug was hidden by > https://crsrc.org/c/content/browser/devtools/protocol/browser_handler.cc;drc=3e7f5adf9807d7eeb6fc72fa58e9fc4c3451f407;l=437 > until now, since chromedriver did not supply the embeddedOrigin until > this CL.) > > Skipping flake verification since this looks like an existing bug (maybe > https://crbug.com/40096995). > > Bug: 384959114 > Validate-Test-Flakiness: skip > Change-Id: I07b59ca281bc4a4a56a37fc313b4d606233c8a60 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7093216 > Reviewed-by: Alex N. Jose <alexnj@chromium.org> > Auto-Submit: Chris Fredrickson <cfredric@chromium.org> > Commit-Queue: Chris Fredrickson <cfredric@chromium.org> > Reviewed-by: Elias Klim <elklm@chromium.org> > Cr-Commit-Position: refs/heads/main@{#1538255} Bug: 384959114, 414530752 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 384959114 Change-Id: I0d28ccd5c49aec302d3b84db6027cf0a7d1dcb68 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7104484 Commit-Queue: Taiyo Mizuhashi <taiyo@chromium.org> Owners-Override: Taiyo Mizuhashi <taiyo@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Cr-Commit-Position: refs/heads/main@{#1538397}
…ame's URL" This is a reland of commit 694c3f3 This version is a bit more careful with TestExpectations, and doesn't remove entries that might still timeout on slower bots (e.g. msan/asan/etc). Original change's description: > Update chromedriver's SetPermission command to use current frame's URL > > The specification says to use the current settings object's origin and > top-level origin, as of w3c/permissions#468 (the > parameter was renamed in w3c/permissions#469). > > Note that this change should be a no-op for all permission types > *except* for `storage-access`, since `storage-access` is the only > permission type whose "permission key" is not the context's top-level > origin. This is why only the storage-access-api WPTs are affected. > > (This CL fixes a bug where PermissionOverrides used the wrong origin for > non-storage-access permissions. This bug was hidden by > https://crsrc.org/c/content/browser/devtools/protocol/browser_handler.cc;drc=3e7f5adf9807d7eeb6fc72fa58e9fc4c3451f407;l=437 > until now, since chromedriver did not supply the embeddedOrigin until > this CL.) > > Skipping flake verification since this looks like an existing bug (maybe > https://crbug.com/40096995). > > Bug: 384959114 > Validate-Test-Flakiness: skip > Change-Id: I07b59ca281bc4a4a56a37fc313b4d606233c8a60 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7093216 > Reviewed-by: Alex N. Jose <alexnj@chromium.org> > Auto-Submit: Chris Fredrickson <cfredric@chromium.org> > Commit-Queue: Chris Fredrickson <cfredric@chromium.org> > Reviewed-by: Elias Klim <elklm@chromium.org> > Cr-Commit-Position: refs/heads/main@{#1538255} Bug: 384959114 Change-Id: Ibe4d28ad5c6359ea0ae43fb00831a4b7824dd89f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7106801 Reviewed-by: Alex N. Jose <alexnj@chromium.org> Commit-Queue: Chris Fredrickson <cfredric@chromium.org> Auto-Submit: Chris Fredrickson <cfredric@chromium.org> Reviewed-by: Elias Klim <elklm@chromium.org> Cr-Commit-Position: refs/heads/main@{#1539450}

Updates the
permissions.setPermissioncommand and thepermission key generation algorithm. The command now accepts an optionaltopLevelOriginparameter to support permissions that require double-keying, such as the Storage Access API. Thepermission key generation algorithmhas been updated to accept origin and top-level origin as direct inputs, instead of an Environment Settings Objects (ESO). This allows WebDriver to properly set a permission, since it doesn't necessarily have an ESO to pass.closes #450
The following tasks have been completed:
Implementation commitment:
Preview | Diff