]> khamidou — GitHub mirrors - electron.git/commitdiff
docs: "loaded" event of "process"
authorCheng Zhao <zcbenz@gmail.com>
Mon, 5 Oct 2015 03:41:36 +0000 (11:41 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 5 Oct 2015 03:41:36 +0000 (11:41 +0800)
docs/api/process.md

index abd3c4fe574c7372b3cb64c64a2d2697d6680c45..4e0fa4d602ef21d8eb3489bd28b1d4b30e7927e8 100644 (file)
@@ -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