Path: csiph.com!aioe.org!news.mb-net.net!open-news-network.org!.POSTED.100.225.197.178.dynamic.wless.zhbmb00p-cgnat.res.cust.swisscom.ch!not-for-mail From: Thomas 'PointedEars' Lahn Newsgroups: comp.lang.javascript Subject: Re: detect a phone Date: Sun, 27 Aug 2017 04:00:45 +0200 Organization: PointedEars Software (PES) Lines: 41 Message-ID: <4031972.LvFx2qVVIh@PointedEars.de> References: <1476139f4sckg$.1gbfz2yz2pha8$.dlg@40tude.net> Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit Injection-Info: gwaiyur.mb-net.net; posting-host="100.225.197.178.dynamic.wless.zhbmb00p-cgnat.res.cust.swisscom.ch:178.197.225.100"; logging-data="13975"; mail-complaints-to="abuse@open-news-network.org" User-Agent: KNode/4.14.2 Cancel-Lock: sha1:AVcQtWRPwZOG528Tp/lyDMxSiUk= X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. On 27/08/2017 3:03 AM, JJ wrote: >> IMO, the presence check of `window.ontouchstart` alone is reliable enough >> to detect whether the device is a mobile device or not. Depends. You can enable support for touch events in Chrome, for mobile testing, *without* the corresponding display size. >> My phone has a 1080x1920 screen, so it has more than 600px on any of its >> screen side. > > The pixel size of an iPhone 7 plus is 1080 x 1920 but the viewport size > is only 441 x 736. > > The pixel size of a Google Pixel is 1080 x 1920 but the viewport size is > 411 x 731. > > The pixel size of a Samsung Galaxy Note 5 is 1440 x 2560 but the > viewport size is 480 x 853. Note that the Note 5 and the failed Note 7 have been succeeded by the Note 8 with QHD+ display as of 2017-08-23. For the Galaxy S7 and S7 Edge at least, the display resolution is now *variable* (a feature of Samsung TouchWiz 6.0, previously only by third- party app): Display resolution is reduced *by default* (on the S7, from WQHD to FHD) in “Power saving mode”. I understand that Samsung Game Launcher can also reduce the display resolution for games if that is desired. Add to that the virtual desktops (split screen) introduced with Android 6.0 “Marshmallow”. > What phone do you have? For real, Samsung Galaxy S7. BrowserStack has others. -- PointedEars FAQ: | | Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.