Skip to content

johanhs/battery-charging-change-notifier

Repository files navigation

Battery Charging Change Notifier

A browser extension that notifies you when your device's battery stops or starts charging.

Purpose

Have you ever experienced your laptop suddenly stop charging without you noticing? Perhaps your charging cable is loose, your power adapter is faulty, or the charging port on your device is unreliable - all of which lead to shorter battery life.
This extension alerts you when your battery stops or starts charging.

How It Works

The extension monitors your device's battery status in the background and displays a notification whenever the charging state changes:

  • Battery Stops Charging: Shows a persistent notification that remains until dismissed or charging resumes
  • Battery Starts Charging: Shows a temporary notification that automatically dismisses after a few seconds

Features

  • Unobtrusive: Runs silently in the background without affecting browser performance
  • Low Resource Usage: Minimal CPU and memory footprint
  • Clear Notifications: Easy-to-understand notifications with battery status & percentage information
  • Cross-Platform Support: Verified on macOS, Linux, Windows 10, and Windows 11 (the required OS system settings for notifications might differ)

Browser Support

  • Compatible With: Chrome, Edge and Opera (any browser that supports the Battery API)
  • Not Compatible With: Brave, Firefox, Safari (these browsers don't support the Battery API)

Important Notes

Ensure you have set the required permissions to display notifications for your browser of choice in your system settings:

  • MacOS: System settings > Notifications > Enable notifications for your Browser AND for your Browser Helper (Alerts)
  • Windows 11: Settings > System > Notifications > Enable Notifications (Get notifications from apps and other senders) AND enable it for your Browser
  • Windows 10: Settings > System > Notifications & actions > Enable Notifications (Get notifications from apps and other senders) enable it for your Browser
  • Linux: Settings > Notifications > App Notifications > Enable for your Browser

Installation

From Chrome Web Store

  1. Install from Chrome Web Store
  2. The extension will start working immediately after installation (if your notifications settings in your os and browser preferences are set correctly)

From Github

  1. Download zip-file from github Download
  2. Extract/unzip the file
  3. Go to the extensions page extensions
  4. Enable "Developer Mode"
  5. Click on the "Load unpacked" button
  6. Choose the extracted/unzipped folder
  7. If your notifications settings in your os and browser preferences are set correctly it should work immediately

Development

This extension is built with TypeScript and uses Webpack for bundling.

Package Manager Requirements

This project uses Yarn 4.9.1 as its package manager. For the best development experience:

  1. Make sure you have Corepack enabled:

    corepack enable
  2. Install dependencies:

    yarn install
  3. Build the project:

    # Development build with watch mode
    yarn dev
    
    # Production build
    yarn build
    
    # Package build as cross-platform zip file using node
    yarn package

    Using npm, pnpm or other Yarn versions has not been tested and may cause unexpected issues.

Privacy

This extension:

  • Does not collect any user data
  • Does not communicate with external servers
  • Only accesses battery status information

License

MIT License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published