Something that works on Chrome, does not work on Brave

I developed this website for my JS practice and when I opened it in Brave, I noticed this. I developed it in Edge Chromium but I wanted to check how it looks like on Brave. It worked fine on Brave mobile but on desktop, it does not work. It works only on Chromium-based browsers and not Firefox. Pls if anyone can help me solve this issue

Basically, this is a site to show the charging of your device. But it is not working on Brave.

Have you tried adjusting the shield settings to see if that changes your results?

1 Like

Yep. But the same thing. No changes. Does it work on your Brave desktop can u tell me pls?

I get the same thing you do on Brave (and Vivaldi), but Iā€™m using a desktop at the moment.

Firefox just shows a black bar for the charging notification. I donā€™t know if thatā€™s expected behavior for a desktop with no battery or not.

Iā€™ll check on my laptop once I get home in a bit.

1 Like

On Desktop. Itā€™ll show charging and 100%. Because thatā€™s what happening. It wonā€™t work on Firefox because the API isnā€™t supported in Firefox. Pls inform me what do you get on laptop. Thanks

@max_programming,
Cool website :slight_smile:
Testing in Brave stable, Beta, Developer and Nightly all have the site showing Charging 100%. Is this not what it should be saying? Chrome shows the same behavior as well. What exactly is it thatā€™s not working?

1 Like

Hi :slight_smile:

@mattches, Brave will allways show charging 100%, no matter what is the current battery state of the device.

Indeed @max_programming, for privacy concerns, the battery API has been tweaked by Brave so that it always returns same fake values (charging and 100%).

1 Like

Yeah, itā€™s showing 100% there too. Looks like that might be the expected behavior on desktop/laptop computers.

1 Like

Okay. So I also think the battery API is tweaked by Brave. But still it works on mobile


It is not working on Windows too. I am on a laptop and still it is showing 100% while my battery is 93%. It is maybe because Brave has tweaked the battery API. On desktops it will show 100% charging because that is what is happening. But on other devices, it should show the battery

Thanks a lot @Mattches. It seems like you are on a desktop. And because desktops are charging and they are 100%. Itā€™ll show that.

Itā€™s a fact @max_programming
And that behaviour (always charging 100%) should be the same on macOS, Windows, Linux and Android.

Not quite sure, but the only exception would be Brave for iOS.

On which mobile platform and Brave version do you see itā€™s working ?

1 Like

It is working on Brave Android

What is your Brave version on Android?

On my end, on the current play store version (1.8.93), and probably since this (https://brave.com/rebuilt-brave-android/), the battery API behaves the same as in desktop Brave => your website is reporting charging 100%, despite the actual battery status of the device.

1 Like

Yeah I updated Brave on mobile and now it is not working. It behaves the same as desktop. Is there a way to tackle this issue?

No, itā€™s a privacy concern.
Itā€™s unlikely that it will change in future versions.

@max_programming,
It was a laptop ā€“ not a desktop but regardless youā€™re right. Iā€™m seeing the same results (100%) with Brave across different OS. Not entirely sure why this is the case but I did reach out to a couple of our web devs to have them take a look.

1 Like

@max_programming,
Upon further inspection, it seems like we block the Battery API thatā€™s likely being utilized by your site:

1 Like

Okay. I understand. Firefox and Safari also donā€™t have battery API. One request, can Brave throw an error in the console just like Firefox and Safari. So that I can show the message just like I show in these browsers:

By the way guys. I want to introduce my YouTube channel.
I am only 15 years old and I love programming.
I know itā€™s kind of an advertisement but I wanted to put this here. Thanks a lot for the help and support

1 Like