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 · all subjects

api

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

API reference topics in Electron

API reference topics include: Process Object, Supported Command Line Switches, Environment Variables, Chrome Extensions Support, and Breaking API Changes.

require('electron').xxx is undefined error

When using Electron built-in modules, an error like 'Cannot read property of undefined' typically means the module is being used in the wrong process. For example, electron.app can only be used in the main process, while electron.webFrame is only available in renderer processes.

Electron classes cannot be subclassed

Electron classes cannot be subclassed with the extends keyword (class inheritance). This feature was never implemented in Electron due to the added complexity it would add to C++/JavaScript interop in Electron's internals.

Electron API capabilities

Electron has dozens of easy-to-use APIs for deeper operating-system integration, written in C++ and Objective-C. These include advanced window customization for transparent or oddly shaped widgets, receiving push notifications from the Apple Push Notification Network, and handling custom URL protocols.

CrashReport Object structure

The CrashReport object has two properties: date of type Date, and id of type string.

EnableHeapProfilingOptions mode property

The mode property is an optional string that controls which processes are profiled, equivalent to --memlog in Chrome. Default is 'all'. Valid values are: 'all' (profile all processes), 'browser' (profile only the browser process), 'gpu' (profile only the GPU process), 'minimal' (profile only the browser and GPU processes), 'renderer-sampling' (profile at most 1 renderer process with fixed probability when started or when heap profiling is enabled), 'all-renderers' (profile all renderer processes), 'utility-sampling' (each utility process has fixed probability of being profiled), 'all-utilities' (profile all utility processes), 'utility-and-browser' (profile all utility processes and the browser process).

EnableHeapProfilingOptions samplingRate property

The samplingRate property is an optional number that controls the sampling interval in bytes. Lower intervals produce more precise profiles at the cost of performance. Default is 100000 (100KB), which is enough to observe allocation sites that make allocations greater than 500KB total, where total equals a single allocation size times the number of such allocations at the same call site. It is equivalent to --memlog-sampling-rate in Chrome. Must be an integer between 1000 and 10000000.

EnableHeapProfilingOptions stackMode property

The stackMode property is an optional string that controls the type of metadata recorded for each allocation, equivalent to --memlog-stack-mode in Chrome. Default is 'native'. Valid values are: 'native' (instruction addresses from unwinding the stack) and 'native-with-thread-names' (instruction addresses from unwinding the stack with thread name as the first frame).

BluetoothDevice object structure

BluetoothDevice is an object with two properties: deviceName (string) and deviceId (string).

Give your agent this brain