Idle
This API is experimental and may not behave as expected.
This API is currently Chromium only.
hibernate()
Put the window into hibernation. This kills the internal browser processes to save the most resources. The page state is lost (as if refreshed).
Examples
index.js
Window.idle.hibernate(); // Hibernate the window
sleep()
Put the window to sleep. This switches to a screenshot of the window instead of the actual window running. The page state is lost (as if refreshed).
Examples
index.js
Window.idle.sleep(); // Put the window to sleep
freeze()
Freeze the window. Halts most execution and background work. The page state is kept when woken (as if nothing happened). Unfreeze using wake()
.
Examples
index.js
Window.idle.freeze(); // Freeze the window
wake()
Wake up the window from hibernation or sleep.
Examples
index.js
Window.idle.wake(); // Wake up the window
auto(enabled, options?)
Enable/disable automatic idle management (disabled by default), and manage it’s options.
Arguments
Enabled
Whether to enable or disable automatic idle management (true/false).
Options
Object of options, all optional including Object itself:
timeMinimizedToHibernate
: How long the window should be minimized before hibernating, in seconds. Defaults to 10.
Examples
index.js
Window.idle.auto(true); // Enable automatic idle management
Window.idle.auto(false); // Disable automatic idle management
Window.idle.auto(true, { // Enable and change options:
timeMinimizedToHibernate: 30 // Be minimized for 30s before hibernating automatically
});