• Hi,

    many plugin, even my Hyper Cache and others, need to detected the device type (looking at the user agent) to serve different content or to chenage their behavior.

    It’s complicated to maintain detection rule on every plugin and the device detection is very important, not everything can be resolved with media queries.

    My suggestion is to introduce a drop-in mechanism to let a plugin (like done by caching plugin) to detect the device and store its result in a global variable (or where is better to store it) so other plugin can rely on that information in a standard an uniform way. Of course the detection can provide a structured information: type and sub-type or like.

    That dropin must work before the advanced-cache.php drop in since even that code may need to know the agent type to look into the correct cache area.

    Stefano Lissa.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Have you tried using Modernizr instead? The better way to go about it is to do feature-detection and keep the ambiguity of the device. You don’t want to start tying down functionality to devices.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    E.g. To target old browsers like IE7 you could check to see whether the browser supports Media Queries:

    Modernizr.mq('only all'); // true if MQ are supported, false if not

    http://modernizr.com/docs/#mq
    (JavaScript)

    Thread Starter Stefano Lissa

    (@satollo)

    The is device capability detection at client side, what I need is a uniform detection at the server side.

    Stefano Lissa.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Stadardized device detection’ is closed to new replies.