[battery] Assess compatibility risk of using [SecureContext]

anssiko has just created a new issue for https://github.com/w3c/battery:

== Assess compatibility risk of using [SecureContext] ==
If we'd add `[SecureContext]` to `partial interface Navigator` and `BatteryManager` as is the current trend, we could drop the following prose:

>If the current settings object is not a secure context, then reject this Navigator object's battery promise with a "SecurityError" DOMException and abort these steps.

However, this would break any feature detection code that relies on checking the existence of properties or objects, e.g.:

```
if ("getBattery" in navigator && "BatteryManager" in window)
  console.log('All your battery are belong to us');
```

I guess nearly everyone using this API must do some sort of feature detection.

My hunch is we want to close this issue as won't fix citing backward compatibility concerns. 

Thoughts?

Please view or discuss this issue at https://github.com/w3c/battery/issues/15 using your GitHub account

Received on Friday, 17 November 2017 12:47:22 UTC