new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Electron · Tutorial · all subjects

process model & context isolation

14 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

RenderProcessGoneDetails object structure

RenderProcessGoneDetails is an object with two properties: reason (string) and exitCode (integer). The reason field describes why the render process is gone. The exitCode field contains the exit code of the process, unless reason is 'launch-failed', in which case exitCode will be a platform-specific launch failure error code.

RenderProcessGoneDetails reason values

The reason property in RenderProcessGoneDetails can have the following values: 'clean-exit' (process exited with exit code zero), 'abnormal-exit' (process exited with non-zero exit code), 'killed' (process was sent SIGTERM or killed externally), 'crashed' (process crashed), 'oom' (process ran out of memory), 'launch-failed' (process never successfully launched), 'integrity-failure' (Windows code integrity checks failed), or 'memory-eviction' (process proactively terminated to prevent future OOM situation).

TouchBarOtherItemsProxy runs in main process

TouchBarOtherItemsProxy operates in the main process.

process.crash causes main thread crash

process.crash() causes the main thread of the current process to crash.

process.hang causes main thread hang

process.hang() causes the main thread of the current process to hang.

process.getCreationTime returns process creation time

process.getCreationTime() returns number | null representing the number of milliseconds since epoch when the application was created. It returns null if the information is unavailable.

process.setFdLimit sets file descriptor limit

process.setFdLimit(maxDescriptors) sets the file descriptor soft limit to maxDescriptors or the OS hard limit, whichever is lower, for the current process. This method is available on macOS and Linux.

Sandboxed renderer process API subset

In sandboxed renderers, the process object contains only a limited subset of APIs: crash(), hang(), getCreationTime(), getHeapStatistics(), getBlinkMemoryInfo(), getProcessMemoryInfo(), getSystemMemoryInfo(), getSystemVersion(), getCPUUsage(), uptime(), argv, execPath, env, pid, arch, platform, sandboxed, contextIsolated, type, version, versions, mas, windowsStore, and contextId.

process.defaultApp property

process.defaultApp is a read-only boolean that is true in the main process when the app is started by being passed as a parameter to the default Electron executable (for example, running 'electron .'). It is undefined otherwise. This can be useful to determine how many arguments need to be sliced off from process.argv.

process.sandboxed property indicates renderer sandbox status

process.sandboxed is a read-only boolean that is true when the renderer process is sandboxed, otherwise it is undefined.

process.contextIsolated property indicates context isolation

process.contextIsolated is a read-only boolean that indicates whether the current renderer context has contextIsolation enabled. It is undefined in the main process.

process.type property values

process.type is a read-only string representing the current process type. Possible values are: 'browser' (the main process), 'renderer' (a renderer process), 'service-worker' (in a service worker), 'worker' (in a web worker), or 'utility' (in a node process launched as a service).

process.contextId property

process.contextId is a read-only string (optional) representing a globally unique ID of the current JavaScript context. Each frame has its own JavaScript context. When contextIsolation is enabled, the isolated world also has a separate JavaScript context. This property is only available in the renderer process.

process.getSystemVersion returns OS version string

process.getSystemVersion() returns a string representing the host operating system version. Examples: '10.13.6' on macOS, '10.0.17763' on Windows, '4.15.0-45-generic' on Linux. It returns the actual operating system version instead of kernel version on macOS, unlike os.release().

Give your agent this brain