DEV Community

Cover image for Battery API - Access your🔋in browser
Luke
Luke

Posted on

Battery API - Access your🔋in browser

This is a submission for DEV Challenge v24.03.20, One Byte Explainer: Browser API or Feature.

Explainer

This API provides everything about system's battery (level, charging or not, etc). Besides that, it has an event listener to help detect the battery level change or charging status change. Can be use to notify client save the data before device die 😏

Additional Context

I have made a tiny project, check it here. You can plug in/out your charger to see what happen

P/s: Strongly recommend not try on PC 🙄

Demo

Demo

Top comments (0)