Re: [battery] Allow use in same-origin children, add Feature Policy integration (#13)

The Devices and Sensors Working Group just discussed `Battery Status`, and agreed to the following:

* `RESOLUTION: Replace SecurityError with NotAllowedError in step 2 of getBattery() algorithm and merge #13.`

<details><summary>The full IRC log of that discussion</summary>
&lt;reillyg> Topic: Battery Status<br>
&lt;anssik> github: https://github.com/w3c/battery/pull/13<br>
&lt;reillyg> Anssi: In Chrome the battery status API is currently available in cross-origin iframes.<br>
&lt;reillyg> ... Mozilla had concerns about this API and dropped it a long time ago.<br>
&lt;reillyg> Tom: Looking at stats on HTTP Archive ads are the biggest user of this cross-origin.<br>
&lt;reillyg> Reilly: It doesn't seem like we've seen a clearly articulated reason not to land this PR.<br>
&lt;tomayac> Usage stats: https://chromestatus.com/metrics/feature/timeline/popularity/2198<br>
&lt;reillyg> Anssi: The issue is breaking sites.<br>
&lt;reillyg> flaki: If you have metrics for APIs like this then from a standardization point of view we should provide more restrictive versions of these APIs.<br>
&lt;reillyg> ... For example, "is on battery power" vs. "what is the current battery level"<br>
&lt;reillyg> Anssi: In retrospect, agreed.<br>
&lt;reillyg> ... The current usage is very high for taking this API away for cross-origin contexts.<br>
&lt;reillyg> Reilly: Ian, do we have exerience taking away APIs like this with FP in other contexts?<br>
&lt;reillyg> ... What has been the reaction?<br>
&lt;reillyg> Ian: Geolocation is currently under feature policy.<br>
&lt;reillyg> Tom: We didn't hear massive outcry.<br>
&lt;reillyg> Ian: It's easy to fix in legitimate use cases.<br>
&lt;reillyg> Anssi: Do we know what will break?<br>
&lt;reillyg> Reilly: chromestatus.com includes top URLs using the API.<br>
&lt;tomayac> The post from geolocation days: https://developers.google.com/web/updates/2016/04/geolocation-on-secure-contexts-only<br>
&lt;reillyg> Reilly: We should post an Intent to Implement/Deprecate and just do it.<br>
&lt;reillyg> Ian: Some people think we should just cut it down to a small number of buckets.<br>
&lt;reillyg> Reilly: I think we should do both.<br>
&lt;tomayac> Intent to deprecate: insecure usage of powerful features: https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/2LXKVWYkOus/gT-ZamfwAKsJ<br>
&lt;reillyg> Ian: Is the proposal still to never resolve the promise?<br>
&lt;reillyg> Reilly: Why not reject with NotAllowedError?<br>
&lt;reillyg> Anssi: For compatibility with existing content.<br>
&lt;reillyg> Reilly: Shouldn't script have already been written to handle other failures?<br>
&lt;reillyg> Ian: We could browse the web with canary running with this disabled and see how bad it is.<br>
&lt;reillyg> Reilly: Both mechanisms will break content but never resolving will break content in weirder ways.<br>
&lt;tomayac> and wronger ways<br>
&lt;reillyg> Reilly: The current PR text rejects with a SecurityError. It should be a NotAllowedError but otherwise is the right behavior.<br>
&lt;reillyg> PROPOSED RESOLUTION: Replace SecurityError with NotAllowedError and merge existing PR.<br>
&lt;reillyg> PROPOSED RESOLUTION: Replace SecurityError with NotAllowedError and merge #13.<br>
&lt;reillyg> PROPOSED RESOLUTION: Replace SecurityError with NotAllowedError in step 2 of getBattery() algorithm and merge #13.<br>
&lt;reillyg> Anssi: Any concerns given wide-scale implications?<br>
&lt;reillyg> [None heard]<br>
&lt;reillyg> Ian: Are there other interfaces in the Battery API which should be gated by FP?<br>
&lt;reillyg> Anssi: getBattery() is the only entrypoint.<br>
&lt;reillyg> RESOLUTION: Replace SecurityError with NotAllowedError in step 2 of getBattery() algorithm and merge #13.<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/battery/pull/13#issuecomment-533378170 using your GitHub account

Received on Friday, 20 September 2019 02:29:10 UTC