[Webkit-unassigned] [Bug 199084] Feature: Implement Device Memory API

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jun 21 02:28:22 PDT 2019


https://bugs.webkit.org/show_bug.cgi?id=199084

--- Comment #3 from Thomas Steiner <tomac at google.com> ---
(In reply to Maciej Stachowiak from comment #2)
> Thanks for the bug report! Does Google search need the Client Hint form of
> this, or is the API sufficient? The post seems to mention that the only use
> is to make a rough cut of "low end device" vs "high end device" based on >=
> 2 GB. It's a shame that the API exposes much more than that. Maybe we could
> expose 2GB as a fixed value for macOS, iOS and iPadOS devices, since all
> currently supported models would likely meet the true "high end" criteria.

The JavaScript API. The current (minified) code uses this:

```
function u(a) {
  var b = window.navigator;
  if (!b)
    return !1;
  b = b.deviceMemory;
  return a.dm && (b < Number(a.dmn) || 0 != Number(a.dmx) && b >= a.dmx) ? !1 : !0
}
```

Capping at (or fixed reporting of) 2GB seems fine (for all iOS/iPadOS devices); actually, Chrome caps at 8GB (https://crbug.com/787473).

Both Chrome's as well as potentially your threshold probably need to be re-evaluated once 2GB of RAM means one owns a "low end" device.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190621/14fc56cf/attachment-0001.html>


More information about the webkit-unassigned mailing list