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
switch to no-user-gesture-required' - disables userGesture constrain #15856
Is your feature request related to a problem? Please describe.
In the browser window some HTML APIs like requestFullScreen can only be invoked by a gesture from the user. I need to execute requestFullScreen(among other APIs) without a user interaction as my app is remotely controlled (via websockets).
Describe the solution you'd like
I would like a switch such app.commandLine.appendSwitch( 'no-user-gesture-required', 'true'); that should remove this requirement to have user interaction for restricted APIs.
Describe alternatives you've considered
I considered webFrame.executeJavaScript(code[, userGesture, callback]) but this is hard to impossible to use because I need to use it in various contexts (i.e. in a class method so I cannot execute 'this.Xmethod()' in a webframe because the javascript I need to execute is local/scoped not global/at the webframe level .
@MarshallOfSound Chromium made it clear that the flags are temporary, experimental and should be used for testing only. No flag exists anymore to disable the gesture requirement.
@buptsky contents.executeJavaScript with userGesture:true is not making the events trusted. For example if you fire a keyboard event as below you will find out that the event is set with attribute isTrusted: false.
Activity
[-]switch to no-user-gesture-required'[/-][+]switch to no-user-gesture-required' - disables userGesture constrain[/+]MarshallOfSound commentedon Nov 28, 2018
@themihai Chromium already has command line switches to disable / change certain gesture requirements / behaviors.
See this page for an incomplete list: https://peter.sh/experiments/chromium-command-line-switches/
It sounds like the flag you want is probably
--disable-gesture-requirement-for-presentationriccardocagnasso commentedon May 18, 2019
--disable-gesture-requirement-for-presentation
Doesn't seem to be supported by electron, please reopen
mihaiav commentedon Nov 7, 2019
@MarshallOfSound Chromium made it clear that the flags are temporary, experimental and should be used for testing only. No flag exists anymore to disable the gesture requirement.
ThalorSe commentedon Dec 29, 2019
you may use the contents.executeJavaScript api and set userGesture with true
mihaiav commentedon Jan 4, 2020
@buptsky contents.executeJavaScript with userGesture:true is not making the events trusted. For example if you fire a keyboard event as below you will find out that the event is set with attribute
isTrusted: false.