docs: userGesture is optional

This commit is contained in:
Cheng Zhao 2015-08-03 14:43:01 +08:00
parent d455232eb1
commit e135bcb5b7

View file

@ -905,14 +905,16 @@ Returns a `String` represents the user agent for this page.
Injects CSS into this page.
### WebContents.executeJavaScript(code, userGesture)
### WebContents.executeJavaScript(code[, userGesture])
* `code` String
* `userGesture` Boolean - Default false
* `userGesture` Boolean
Evaluates `code` in page. If `userGesture` is set will create user gesture context,
HTML api like `requestFullScreen` which require user action can take advantage
of this option for automation.
Evaluates `code` in page.
In browser some HTML APIs like `requestFullScreen` can only be invoked if it
is started by user gesture, by specifying `userGesture` to `true` developers
can ignore this limitation.
### WebContents.setAudioMuted(muted)