Dimitar Petrov > Plack-Middleware-BrowserDetector-0.04 > Plack::Middleware::BrowserDetector

Download:
Plack-Middleware-BrowserDetector-0.04.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source  

NAME ^

Plack::Middleware::BrowserDetector - Plack middleware to identify browsers

SYNOPSIS ^

  # in your .psgi
  ...
  builder {
    enable 'BrowserDetector';
    $app;
  }

  # and after that in your aplication
  my $browser = $env->{'BrowserDetector.browser'}; # HTTP::BrowserDetect object

  # check if browser appears to be mobile device
  if ($browser->mobile) {
  }

  # check if browser appears to be chrome
  if ($browser->chrome) {
  }

DESCRIPTION ^

This Plack middleware sets a key in the PSGI environment which is HTTP::BrowserDetect object. The HTTP::BrowserDetect determines Web browser, version, and platform from an HTTP user agent string.

See also: Plack::Middleware::BotDetector, HTTP::BrowserDetect

AUTHOR ^

Dimitar Petrov <mitakaa@gmail.com>

syntax highlighting: