DEV Community

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

Posted on

2 2 2 1 1

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

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Cloudinary image

Optimize, customize, deliver, manage and analyze your images.

Remove background in all your web images at the same time, use outpainting to expand images with matching content, remove objects via open-set object detection and fill, recolor, crop, resize... Discover these and hundreds more ways to manage your web images and videos on a scale.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay