ZTE Open userAgent String

痴心易碎 提交于 2019-12-08 11:37:53

问题


could someone plz provide me the User-Agent-String (navigator.userAgent) of the ZTE Open device? I need it to disable memory-hungry features in my app on devices with 256 MB of RAM. There's no way to get information about available RAM at the moment and I can't do those features with less memory consumption. (on 512 MB RAM they will work)

By now I have those User-Agent-Strings:

ALCATEL One Touch Fire

Mozilla/5.0 (Mobile; ALCATELOneTouch4012X; rv:18.1) Gecko/18.1 Firefox/18.1

GeeksPhone Keon

Mozilla/5.0 (Mobile; rv:18.1) Gecko/18.1 Firefox/18.1

greetings, André


回答1:


Short answer:

Mozilla/5.0 (Mobile; ZTEOPEN; rv:18.1) Gecko/18.1 Firefox/18.1

Source.

Also, if you want to know the LG Fireweb UA string, it is:

Mozilla/5.0 (Mobile; LG-D300; rv:18.1) Gecko/18.1 Firefox/18.1

Long answer

The Keon UA string is actually the Mozilla's recommended UA string for all Firefox OS smartphones. See the gecko user agent string reference, which means that you can be serving the simplified version of your website for devices with lots of RAM in the future, devices that would use the recommended string and that are not Geeksphone Keon, a Nexus 4 running Firefox OS for example.

And that is the trouble of using user agent sniffing. That practice should be avoided whenever possible because of it's fragility as you may already know… relying on UA sniffing instead of feature detection is not a good practice.

There are some ways to test the performance of your page without trying to guess which device/platform/version your visitor uses, RequestAnimationFrame can be an alternative way to probe the actual responsiveness of your app for example, but I don't know if that would be enough for your usecase.




回答2:


I got

Mozilla/5.0 (Mobile; rv:18.0) Gecko/18.0 Firefox/18.0

with my ZTE Open running 1.0.1.0.




回答3:


I maintain a list of Firefox OS devices for WhichBrowser - a user agent sniffing library. It currently contains the following device identifiers for Firefox OS:

DeviceModels::$FIREFOXOS_MODELS = array(
    'ALCATEL ONE TOUCH 4012A'                   => array( 'Alcatel', 'One Touch Fire' ),
    'ALCATELOneTouch4012A'                      => array( 'Alcatel', 'One Touch Fire' ),
    'ALCATELOneTouch4012X'                      => array( 'Alcatel', 'One Touch Fire' ),
    'ALCATELOneTouch4019X'                      => array( 'Alcatel', 'One Touch Fire C' ),
    'LG-D300'                                   => array( 'LG', 'Fireweb' ),
    'ZTEOPEN'                                   => array( 'ZTE', 'Open' ),
    'OpenC'                                     => array( 'ZTE', 'Open C' ),
);

An up-to-date version can be found here: https://github.com/NielsLeenheer/WhichBrowser/blob/master/data/models-firefoxos.php




回答4:


I got a hint that I can read /proc/meminfo with the FileReader API to get detailed memory info on all devices. Have to check this later. :)

Edit:

Can't get it working. I tried this invalid one:

var file = new File('/proc/meminfo');
var reader = new FileReader();
reader.onload = function(evt) {
    alert(evt.target.result);
};
reader.readAsText(file);

Then I tried this one:

var req = new XMLHttpRequest();
req.open('GET', '/proc/meminfo', true);
req.onreadystatechange = function (evt) {
  if (req.readyState == 4) {
      alert(req.responseText);
  }
};
req.send(null);

And I tried it with "systemXHR": {} permission:

var req = new XMLHttpRequest({
    mozSystem: true
});
req.open('GET', '/proc/meminfo', true);
req.onreadystatechange = function (evt) {
  if (req.readyState == 4) {
      alert(req.responseText);
  }
};
req.send(null);

nothing did work.



来源:https://stackoverflow.com/questions/20103893/zte-open-useragent-string

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!