navigator.getBattery() not working on S3 static website

71 Views Asked by At

Normally in Chrome I can get the battery level by doing something like

navigator.getBattery().then((battery) => {
    console.log(battery.level)
})

This works fine when testing with a local file and on other websites, however, when I try to do this on an S3 static website it gives me this error: Uncaught TypeError: navigator.getBattery is not a function. This is in Chrome which supports the getBattery method. The only difference is that it is on an S3 static website. Why is this method not found when hosting on S3?

0

There are 0 best solutions below