Process management
Request graceful browser-instance shutdown from a privileged plugin using chrovia.process.exit.
Entitlement: processManagement. API: chrovia.process.exit(). No EP switch is required. Normally call it from a Provision Service Worker.
Exit on an explicit command
function exitBrowser() {
const processApi = globalThis.chrovia?.process;
if (!processApi) {
throw new Error('processManagement is required');
}
processApi.exit();
}Connect this function to your plugin's own validated command handler. It is deliberately not invoked automatically at worker load. A popup should send a specific command to its worker rather than access the API directly.
exit() returns undefined, not a Promise or exit code. It requests Chromium's graceful browser-exit flow; it does not synchronously terminate the process or guarantee the exact moment it disappears. Flush required application work before requesting exit, and let your external launcher observe actual termination if needed.
Scope
This affects the browser instance, including its windows, not only one tab or plugin. The API has no method for starting another process, choosing an exit code, or killing an unrelated process.
For automatic shutdown when your launcher exits or a presence file disappears, use the separate supervisorProcess capability. Granting processManagement does not start a supervisor watcher, and supervision's automatic exit does not require calling this JS method.
Verify
Test with a disposable instance and no unsaved work. If the domain is missing, check the License and Service Worker context. A page implementation would additionally need unrestrictedApi, which exposes more than an isolated exit button; prefer the plugin message path.