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 request: Access to "user gesture" flag, especially in 'new-window' event #9973

Open
pfrazee opened this issue Jul 11, 2017 · 2 comments

Comments

@pfrazee
Copy link
Contributor

pfrazee commented Jul 11, 2017

Knowing whether the user initiated the new-window event is important for blocking unwanted popups in a webview. Without it, an untrusted page can call window.open() or anchorTag.click() to trigger popups at will.

In webContents.executeJavascript, we have a userGesture parameter which overrides the flag indicating whether the user triggered an event.

Is it possible for the application to get access to the state of that flag via a function call - something like webContents.hasUserGesture()? If not, could we get access to it in the new-window event via an attribute, event.hasUserGesture ?

(I can make a PR if somebody can assure me this is doable, and point to relevant APIs.)

@themihai
Copy link

I need to set disable userGesture constrain so a PR would be great.
#15856

@sentialx
Copy link
Contributor

+1 I just wanted to open a new issue, but I saw this. Is there any progress on it?

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

No branches or pull requests

5 participants