power

The power permission allows an extension to override the system's power management features.

What it does

  • Grants access to the chrome.power API.
  • Allows an extension to request a power-saving mode to be temporarily disabled.
  • An extension can request to keep the system awake (system level) or just keep the display on (display level).

When to use it

This is for extensions that need to perform long-running tasks where the system going to sleep would be disruptive.

Examples:

  • A presentation app that needs to keep the screen on.
  • An extension that is performing a large file upload or download and needs to prevent the system from sleeping until it's complete.
  • A kiosk-mode application that must remain active and visible at all times.

Manifest Declaration

{
  "name": "My Keep-Awake Extension",
  "version": "1.0",
  "manifest_version": 3,
  "permissions": [
    "power"
  ]
}

Security & Privacy

Why is it not risky?

This permission allows an extension to prevent your computer or screen from going to sleep. For example, a presentation extension would use this to keep the screen on during your talk.

This is a safe permission. The worst a malicious or poorly made extension could do is run down your laptop's battery faster than usual. It cannot access any of your data.

API Usage Example

This example demonstrates how to keep the display on.

// background.js

let keepAwake = false;

// Toggle the keep-awake state when the user clicks the action icon
chrome.action.onClicked.addListener(() => {
  keepAwake = !keepAwake;
  if (keepAwake) {
    // Request to keep the display on. The request is active
    // until it's released or the extension is unloaded.
    chrome.power.requestKeepAwake('display');
    console.log('Requesting to keep display on.');
    chrome.action.setIcon({ path: 'images/on.png' });
  } else {
    // Release the request, allowing the system to manage power normally.
    chrome.power.releaseKeepAwake();
    console.log('Releasing keep-awake request.');
    chrome.action.setIcon({ path: 'images/off.png' });
  }
});

Extensions with the power permission

Here are some popular browser extensions that use the "power" permission. To explore more, try our Advanced search.

References


Related Permissions

Permission Metrics

Popularity

Security Risk


Usage by Platform