Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #24185

Re: Detection of devices using JavaScript

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!mit.eternal-september.org!.POSTED!not-for-mail
From Simon Lewis <simonlewis2001@gmail.com>
Newsgroups comp.lang.javascript
Subject Re: Detection of devices using JavaScript
Date Fri, 16 May 2014 15:14:51 +0200
Organization Lewis
Lines 35
Message-ID <87lhu150hg.fsf@development.richardriley.net> (permalink)
References <be99109d-a09b-4374-bd4d-68c746d3405d@googlegroups.com> <ll2ptp$bep$1@dont-email.me> <2757558.IxYUr6dfcW@PointedEars.de> <5374f76d$0$6664$9b4e6d93@newsspool3.arcor-online.net> <99395878-fe47-4f8d-986e-b10a4e9ae636@googlegroups.com> <5375f07e$0$6699$9b4e6d93@newsspool2.arcor-online.net>
Mime-Version 1.0
Content-Type text/plain
Injection-Info mit.eternal-september.org; posting-host="c7deb0ebd8c5bec08dc118bf5be1a1cf"; logging-data="18142"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/WowXtFC3GWo8998nm92TNoqcZ61HxkgY="
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
Cancel-Lock sha1:NcUwE4H+XLk6TNuBzo97xb/5pzU= sha1:3DoesZ6XAbqF9yaaiGYnAu+txsI=
Xref csiph.com comp.lang.javascript:24185

Show key headers only | View raw


Christoph Michael Becker <cmbecker69@arcor.de> writes:

> Sithu.D wrote:
>
>> On Thursday, May 15, 2014 7:20:53 PM UTC+2, Christoph Michael Becker
>> wrote:
>> 
>>> Thomas 'PointedEars' Lahn wrote:
>>> 
>>>> In most cases the need to "detect the type of device and os" is
>>>> only a need
>>> 
>>>> perceived because of lack of experience, not an actual need.
>>> 
>>> ACK (at least wrt. to browser side scripting).
>> 
>> Thanks, Christoph. It turns out all that I need is a regex pattern to
>> search the User Agent after all. I got conflicting requirements. The
>> real idea is to detect a mobile device on a website and then show the
>> user an app download page.
>
> As Thomas has already hinted at, using the user agent string to detect
> the browser/device is unreliable.  See
> <http://pointedears.de/scripts/faq/cljs/#detectBrowser>; the article
> doesn't deal with mobile devices, but the issues pointed out are
> basically the same.  At least you should offer some way to get to the
> download page for all users.
>
> However, it seems to be preferable to look for a more reliable solution
> in the first place.  I don't know if there exists such a solution,
> though.

No. Use the user agent. Why? because thats what people use when they
*want* the full content or alternate content for a different device.

Back to comp.lang.javascript | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Detection of devices using JavaScript "Sithu.D" <zebra05@gmail.com> - 2014-05-15 02:32 -0700
  Re: Detection of devices using JavaScript Denis McMahon <denismfmcmahon@gmail.com> - 2014-05-15 16:27 +0000
    Re: Detection of devices using JavaScript Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-05-15 18:40 +0200
      Re: Detection of devices using JavaScript Christoph Michael Becker <cmbecker69@arcor.de> - 2014-05-15 19:20 +0200
        Re: Detection of devices using JavaScript "Sithu.D" <zebra05@gmail.com> - 2014-05-15 23:56 -0700
          Re: Detection of devices using JavaScript Christoph Michael Becker <cmbecker69@arcor.de> - 2014-05-16 13:03 +0200
            Re: Detection of devices using JavaScript Simon Lewis <simonlewis2001@gmail.com> - 2014-05-16 15:14 +0200
              Re: Detection of devices using JavaScript Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-05-16 15:46 +0200
      Re: Detection of devices using JavaScript John Harris <niam@jghnorth.org.uk.invalid> - 2014-05-16 09:49 +0100

csiph-web