Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Get the Permissions Policy state of a frame. #31477

Closed
AlbertoFDR opened this issue Jun 28, 2024 · 3 comments
Closed

[Feature]: Get the Permissions Policy state of a frame. #31477

AlbertoFDR opened this issue Jun 28, 2024 · 3 comments

Comments

@AlbertoFDR
Copy link

AlbertoFDR commented Jun 28, 2024

🚀 Feature Request

Getting the permissions policy state of a frame (top-level-document or included iframe). The idea would be to have a new method on the Frame object, similar to what the CDP allows with Page.getPermissionsPolicyState(frameId).

Example

https://foo.bar/ includes an iframe with the allow tag.

  • <iframe src="https://example.org/" allow="geolocation"></iframe>

Playwright would be able to give us the permissions policy state on each frame. For the case of https://example.org/ ,the result for geolocation permission would be allowed: true. If we check autoplay permission the result would be allowed: false and the reason ( IframeAttribute).

Motivation

This feature would give the option for developers/testers to easily check if their embedded widget can have access to the permission or why not (CDP blockReason example: IframeAttribute).

@pavelfeldman
Copy link
Member

This feature would give the option for developers/testers to easily check if their embedded widget can have access to the permission or why not (CDP blockReason example: IframeAttribute).

That sounds like an artificial use case for testing - Chrome DevTools would probably work better for this. What is your exact use case?

@AlbertoFDR
Copy link
Author

Thanks for the quick answer.

In my case, I'm running a security experiment and one of the features that I'm adding, is the permission policy state of all the frames included in a document and document itself.

I still think there are interesting use cases for developers and testers:

  • Checking that the Permission Policy Header is well-deployed in all the endpoints of their company.
  • Knowing which kind of third-party widgets included in any of their websites have the ability to use/prompt for the permission.

@pavelfeldman
Copy link
Member

This request sounds very niche. For the security auditing I would suggest that analyze the actual artifacts to contain required permissions and CSP directives instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants