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?
If we'd add
[SecureContext]topartial interface NavigatorandBatteryManageras is the current trend, we could drop the following prose:However, this would break any feature detection code that relies on checking the existence of properties or objects, e.g.:
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?