You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Including low-entropy hints along with high-entropy hints in UADataValues seems like a reasonable thing to do, giving developers a clear way of requesting "UA Stuff", which seems like the way folks would be expected to use getHighEntropyValues(). There's something of a question there around API design (should we have a getAllValues() instead? Or a getJustLowEntropyValues()?) that seems like it would benefit from broader circulation.
The rationale for returning low-entropy hints along with high-entropy hints from getHighEntropyValues() is captured in #222 (comment), but essentially, if values change from high to low, we risk breaking deployed code.
Currently we have getHighEntropyValues(), and if you want low-entropy values, you'll have to grab those off of the NavigatorUAData interface directly.
There's a few scenarios where what Mike is proposing may be useful, and probably more that I'm not thinking about:
you want all the data (this assumes the UA is willing to give it to you), in a single API call
a hint has somehow transitioned from high to low entropy, or from low to high (we have half a solution for this)
you want a promise-y API to collect all the low entropy hints (otherwise you have to iterate over NavigatorUAData yourself and return your own promise)
you want all the data (this assumes the UA is willing to give it to you), in a single API call
I'm trying to think of a use case for this beyond wanting to get a signature / fingerprint. As in, a call like this would presumably return any new hints that got added in the future. If I need that information for something functional, I should be explicitly requesting the token.
Something like option 3 seems kind of nice to me. Leave the default low-entropy values available as simple attributes so I don't need to mess around with a Promise, but likewise give me a general getValues() or similar that will accept all valid tokens. e.g.
Yeah, I like the ergo of having everything in one function if you need to do something Promise-y anyways. My worry is trying to turn a low entropy hint back into a high one.
I'd almost be tempted to get rid of the non-Promise getters and say promises for everything if it wasn't so insanely disruptive to switch to async
Some feedback we got from @mikewest, in a blink-dev I2P:
The rationale for returning low-entropy hints along with high-entropy hints from
getHighEntropyValues()
is captured in #222 (comment), but essentially, if values change from high to low, we risk breaking deployed code.Currently we have
getHighEntropyValues()
, and if you want low-entropy values, you'll have to grab those off of theNavigatorUAData
interface directly.There's a few scenarios where what Mike is proposing may be useful, and probably more that I'm not thinking about:
NavigatorUAData
yourself and return your own promise)I'm curious if other folks have thoughts here. @erik-anderson @amtunlimited @rowan-m @othermaciej
(This may also be an area where it's useful for some developers to get more familiar with the API so they can comment on ergonomics).
The text was updated successfully, but these errors were encountered: