From: Cheng Zhao Date: Mon, 3 Aug 2015 06:43:01 +0000 (+0800) Subject: docs: userGesture is optional X-Git-Tag: v0.30.3~21 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=e135bcb5b71697c4be49620e89cd07da63a47925;p=electron.git docs: userGesture is optional --- diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index e4cabd52..add5cfff 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -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)