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

feat: provide the frame URL with permission requests and checks #18757

Merged
merged 3 commits into from Jun 13, 2019

Conversation

MarshallOfSound
Copy link
Member

@MarshallOfSound MarshallOfSound commented Jun 12, 2019

Fixes #18755

Users need to be able to know where the origin of the permission request is.

Notes: Added requestingUrl and isMainFrame properties to the permission request and permission check handlers details objects so that apps can check the origin of the requesting frame rather than the root frame.

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Jun 12, 2019
@@ -284,15 +284,16 @@ win.webContents.session.setCertificateVerifyProc((request, callback) => {
#### `ses.setPermissionRequestHandler(handler)`

* `handler` Function | null
* `webContents` [WebContents](web-contents.md) - WebContents requesting the permission.
* `webContents` [WebContents](web-contents.md) - WebContents requesting the permission. Please note that if the request comes from a subframe you should use `requestingUrl` to check the request origin.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MarshallOfSound @felixrieseberg would it be productive to provide a snippet showing an example of this?

Also provides a handy isMainFrame property to determine if it is an
iframe making the request
@MarshallOfSound MarshallOfSound merged commit ac02ab9 into master Jun 13, 2019
@release-clerk
Copy link

release-clerk bot commented Jun 13, 2019

Release Notes Persisted

Added requestingUrl and isMainFrame properties to the permission request and permission check handlers details objects so that apps can check the origin of the requesting frame rather than the root frame.

@MarshallOfSound MarshallOfSound deleted the feat/permission-frame-url branch June 13, 2019 18:11
@trop
Copy link
Contributor

trop bot commented Jun 13, 2019

I was unable to backport this PR to "4-2-x" cleanly;
you will need to perform this backport manually.

@trop
Copy link
Contributor

trop bot commented Jun 13, 2019

I was unable to backport this PR to "5-0-x" cleanly;
you will need to perform this backport manually.

@trop
Copy link
Contributor

trop bot commented Jun 13, 2019

I was unable to backport this PR to "3-1-x" cleanly;
you will need to perform this backport manually.

@trop
Copy link
Contributor

trop bot commented Jun 13, 2019

I have automatically backported this PR to "6-0-x", please check out #18772

MarshallOfSound added a commit that referenced this pull request Jun 13, 2019
* feat: provide the frame URL with permission requests and checks

Also provides a handy isMainFrame property to determine if it is an
iframe making the request

* chore: refactor to use base::Value

* chore: use Set<Type>Key over SetPath
@trop
Copy link
Contributor

trop bot commented Jun 13, 2019

A maintainer has manually backported this PR to "5-0-x", please check out #18773

MarshallOfSound added a commit that referenced this pull request Jun 13, 2019
* feat: provide the frame URL with permission requests and checks

Also provides a handy isMainFrame property to determine if it is an
iframe making the request

* chore: refactor to use base::Value

* chore: use Set<Type>Key over SetPath
@trop
Copy link
Contributor

trop bot commented Jun 13, 2019

A maintainer has manually backported this PR to "3-1-x", please check out #18774

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Jun 15, 2019
@sofianguy sofianguy added this to Fixed in 6.0.0-beta.9 in 6.1.x Jun 19, 2019
MarshallOfSound added a commit that referenced this pull request Jun 24, 2019
* feat: provide the frame URL with permission requests and checks

Also provides a handy isMainFrame property to determine if it is an
iframe making the request

* chore: refactor to use base::Value

* chore: use Set<Type>Key over SetPath
zcbenz pushed a commit that referenced this pull request Jul 11, 2019
…) (#18773)

* feat: provide the frame URL with permission requests and checks

Also provides a handy isMainFrame property to determine if it is an
iframe making the request

* chore: refactor to use base::Value

* chore: use Set<Type>Key over SetPath
trop bot pushed a commit that referenced this pull request Jul 11, 2019
* feat: provide the frame URL with permission requests and checks

Also provides a handy isMainFrame property to determine if it is an
iframe making the request

* chore: refactor to use base::Value

* chore: use Set<Type>Key over SetPath
codebytere pushed a commit that referenced this pull request Jul 12, 2019
…) (#19204)

* feat: provide the frame URL with permission requests and checks

Also provides a handy isMainFrame property to determine if it is an
iframe making the request

* chore: refactor to use base::Value

* chore: use Set<Type>Key over SetPath
@sofianguy sofianguy added this to Fixed in 5.0.7 in 5.0.x Jul 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
5.0.x
Fixed in 5.0.7
6.1.x
Fixed in 6.0.0-beta.9
Development

Successfully merging this pull request may close these issues.

session.setPermissionRequestHandler for iframes has incorrect content URL
4 participants