Re: Unofficial API draft "Device Information API"

Sangwhan Moon
> On 19 Oct 2016, at 3:20 AM, Futomi Hatano <futomi.hatano@newphoria.co.jp> wrote:
> 
> Hi all,
> 
> At the Group meeting at TPAC 2016, we listed APIs
> which will be disicussed in the incoming WG.
> https://www.w3.org/community/websignage/wiki/Group_meeting_at_TPAC_2016#APIs
> 
> Though the WG has not been chartered yet, I tried to
> create an API draft "Device Information API".
> You can see the draft on my personal github account.
> http://rawgit.com/futomi/W3C_Web-based_Signage_BG/master/device_infomation_api.html
> 
> I know that the "Device Information API" is not decided to
> be included in the scope of the WG.
> I just hope this draft makes our discussion active.
> 

Just as a curious question, why Promises? Most of that information is static, so everything is already known at the time of creation and returning said DeviceInfo object should be instant, if not in constant (and very short) time.

The only case where the promise makes sense is if the context has navigated away from the initial URL (if I understood the design correctly) but if it's a synchronous API, this would be a security violation so throwing would be perfectly appropriate. (Additionally, this simplifies the implementation for implementors who will be implementing this with say, addJavascriptInterface())

(I'm a non-member, so take my input as a simple comment)

Received on Wednesday, 19 October 2016 01:51:22 UTC