From: Cheng Zhao Date: Mon, 5 Oct 2015 03:41:36 +0000 (+0800) Subject: docs: "loaded" event of "process" X-Git-Tag: v0.33.5~1 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=ad8e727ba251b559e48625680a50cc014f26b0e5;p=electron.git docs: "loaded" event of "process" --- diff --git a/docs/api/process.md b/docs/api/process.md index abd3c4fe..4e0fa4d6 100644 --- a/docs/api/process.md +++ b/docs/api/process.md @@ -9,7 +9,25 @@ upstream node: * `process.versions['chrome']` String - Version of Chromium. * `process.resourcesPath` String - Path to JavaScript source code. -# Methods +## Events + +### Event: 'loaded' + +Emitted when Electron has loaded its internal initialization script and is +beginning to load the web page or the main script. + +It can be used by the preload script to add removed Node global symbols back to +the global scope when node integration is turned off: + +```js +// preload.js +process.once('loaded', function() { + global.setImmediate = setImmediate; + global.clearImmediate = clearImmediate; +}); +``` + +## Methods The `process` object has the following method: @@ -17,7 +35,7 @@ The `process` object has the following method: Causes the main thread of the current process hang. -## process.setFdLimit(maxDescriptors) _OS X_ _Linux_ +### process.setFdLimit(maxDescriptors) _OS X_ _Linux_ * `maxDescriptors` Integer