W3C home > Mailing lists > Public > public-device-apis-log@w3.org > November 2017

[battery] Assess compatibility risk of using [SecureContext]

From: Anssi Kostiainen via GitHub <sysbot+gh@w3.org>
Date: Fri, 17 Nov 2017 12:47:20 +0000
To: public-device-apis-log@w3.org
Message-ID: <issues.opened-274854522-1510922839-sysbot+gh@w3.org>
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

This archive was generated by hypermail 2.3.1 : Friday, 17 November 2017 12:47:23 UTC