📝 Simpilify the structure of API references.

This commit is contained in:
Cheng Zhao 2014-05-05 14:24:57 +08:00
parent fae3cf9a55
commit 5933947000
19 changed files with 26 additions and 26 deletions

22
docs/api/ipc-renderer.md Normal file
View file

@ -0,0 +1,22 @@
# ipc (renderer)
The `ipc` module provides a few methods so you can send synchronous and
asynchronous messages to the browser, and also receive messages sent from
browser. If you want to make use of modules of browser from renderer, you
might consider using the [remote](remote.md) module.
See [ipc (browser)](ipc-browser.md) for examples.
## ipc.send(channel[, args...])
Send `args..` to the web page via `channel` in asynchronous message, the browser
process can handle it by listening to the `channel` event of `ipc` module.
## ipc.sendSync(channel[, args...])
Send `args..` to the web page via `channel` in synchronous message, and returns
the result sent from browser. The browser process can handle it by listening to
the `channel` event of `ipc` module, and returns by setting `event.returnValue`.
**Note:** Usually developers should never use this API, since sending
synchronous message would block the whole web page.