You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature request: Access to "user gesture" flag, especially in 'new-window' event #9973
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.)
Activity
themihai commentedon Nov 27, 2018
I need to set disable userGesture constrain so a PR would be great.
#15856
sentialx commentedon Jul 29, 2019
+1 I just wanted to open a new issue, but I saw this. Is there any progress on it?
MarshallOfSound commentedon Aug 25, 2026
The
new-windowevent was removed a while ago