

Browser — browser v0.5.0

 try {

 if (localStorage.getItem('night-mode') === 'true') {

 document.body.classList.add('night-mode');

 }

 } catch (error) { }

 

Browser

(browser v0.5.0)

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L1 "View Source")

============================================================================================================================

[Link to this section](#summary)

 Summary

==========================================

[Functions](#functions)

------------------------

[adobe\_air?(input)](#adobe_air?/1)

[android?(input, version \\ nil)](#android?/2)

[android\_version(input)](#android_version/1)

[blackberry?(input, version \\ nil)](#blackberry?/2)

[blackberry\_running\_safari?(input)](#blackberry_running_safari?/1)

[blackberry\_version(input)](#blackberry_version/1)

[bot?(input, options \\ [])](#bot?/2)

[bot\_name(input, options \\ [])](#bot_name/2)

[chrome?(input)](#chrome?/1)

[chrome\_os?(input)](#chrome_os?/1)

[compatibility\_view?(input)](#compatibility_view?/1)

[console?(input)](#console?/1)

[core\_media?(input)](#core_media?/1)

[detect\_version?(actual\_version, expected\_version)](#detect_version?/2)

[device\_type(input)](#device_type/1)

[edge?(input)](#edge?/1)

[firefox?(input)](#firefox?/1)

[full\_browser\_name(input)](#full_browser_name/1)

[full\_display(input)](#full_display/1)

[full\_platform\_name(input)](#full_platform_name/1)

[full\_version(input)](#full_version/1)

[id(input)](#id/1)

[ie?(input, version \\ nil)](#ie?/2)

[ios?(input, version \\ nil)](#ios?/2)

[ios\_version(input)](#ios_version/1)

[ipad?(input)](#ipad?/1)

[iphone?(input)](#iphone?/1)

[ipod?(input)](#ipod?/1)

[kindle?(input)](#kindle?/1)

[known?(input)](#known?/1)

[linux?(input)](#linux?/1)

[mac?(input)](#mac?/1)

[mac\_version(input)](#mac_version/1)

[mac\_version\_name(input)](#mac_version_name/1)

[mobile?(input)](#mobile?/1)

[modern?(input)](#modern?/1)

[modern\_edge?(ua)](#modern_edge?/1)

[modern\_firefox?(ua)](#modern_firefox?/1)

[modern\_firefox\_tablet?(ua)](#modern_firefox_tablet?/1)

[modern\_ie\_version?(ua)](#modern_ie_version?/1)

[modern\_opera?(ua)](#modern_opera?/1)

[msie\_full\_version(input)](#msie_full_version/1)

[msie\_version(ua)](#msie_version/1)

[name(input)](#name/1)

[nintendo?(input)](#nintendo?/1)

[opera?(input)](#opera?/1)

[opera\_mini?(input)](#opera_mini?/1)

[phantom\_js?(input)](#phantom_js?/1)

[platform(input)](#platform/1)

[playbook?(input)](#playbook?/1)

[playstation4?(input)](#playstation4?/1)

[playstation?(input)](#playstation?/1)

[psp?(input)](#psp?/1)

[psp\_vita?(input)](#psp_vita?/1)

[quicktime?(input)](#quicktime?/1)

[safari?(input)](#safari?/1)

[safari\_webapp\_mode?(input)](#safari_webapp_mode?/1)

[search\_engine?(input)](#search_engine?/1)

[silk?(input)](#silk?/1)

[surface?(input)](#surface?/1)

[tablet?(input)](#tablet?/1)

[tv?(input)](#tv?/1)

[uc\_browser?(input)](#uc_browser?/1)

[version(input)](#version/1)

[webkit?(input)](#webkit?/1)

[windows10?(input)](#windows10?/1)

[windows7?(input)](#windows7?/1)

[windows8?(input)](#windows8?/1)

[windows8\_1?(input)](#windows8_1?/1)

[windows?(input)](#windows?/1)

[windows\_mobile?(input)](#windows_mobile?/1)

[windows\_phone?(input)](#windows_phone?/1)

[windows\_rt?(input)](#windows_rt?/1)

[windows\_touchscreen\_desktop?(input)](#windows_touchscreen_desktop?/1)

[windows\_version\_name(input)](#windows_version_name/1)

[windows\_vista?(input)](#windows_vista?/1)

[windows\_wow64?(input)](#windows_wow64?/1)

[windows\_x64?(input)](#windows_x64?/1)

[windows\_x64\_inclusive?(input)](#windows_x64_inclusive?/1)

[windows\_xp?(input)](#windows_xp?/1)

[xbox?(input)](#xbox?/1)

[xbox\_one?(input)](#xbox_one?/1)

[yandex?(input)](#yandex?/1)

[Link to this section](#functions)

Functions

=============================================

[Link to this function](#adobe_air?/1 "Link to this function")

adobe\_air?(input)

==================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L442 "View Source")

[Link to this function](#android?/2 "Link to this function")

android?(input, version \\ nil)

===============================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L455 "View Source")

[Link to this function](#android_version/1 "Link to this function")

android\_version(input)

=======================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L460 "View Source")

[Link to this function](#blackberry?/2 "Link to this function")

blackberry?(input, version \\ nil)

==================================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L243 "View Source")

[Link to this function](#blackberry_running_safari?/1 "Link to this function")

blackberry\_running\_safari?(input)

===================================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L248 "View Source")

[Link to this function](#blackberry_version/1 "Link to this function")

blackberry\_version(input)

==========================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L236 "View Source")

[Link to this function](#bot?/2 "Link to this function")

bot?(input, options \\ [])

==========================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L259 "View Source")

[Link to this function](#bot_name/2 "Link to this function")

bot\_name(input, options \\ [])

===============================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L271 "View Source")

[Link to this function](#chrome?/1 "Link to this function")

chrome?(input)

==============

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L210 "View Source")

[Link to this function](#chrome_os?/1 "Link to this function")

chrome\_os?(input)

==================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L576 "View Source")

[Link to this function](#compatibility_view?/1 "Link to this function")

compatibility\_view?(input)

===========================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L419 "View Source")

[Link to this function](#console?/1 "Link to this function")

console?(input)

===============

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L313 "View Source")

[Link to this function](#core_media?/1 "Link to this function")

core\_media?(input)

===================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L188 "View Source")

[Link to this function](#detect_version?/2 "Link to this function")

detect\_version?(actual\_version, expected\_version)

====================================================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L70 "View Source")

[Link to this function](#device_type/1 "Link to this function")

device\_type(input)

===================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L360 "View Source")

[Link to this function](#edge?/1 "Link to this function")

edge?(input)

============

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L388 "View Source")

[Link to this function](#firefox?/1 "Link to this function")

firefox?(input)

===============

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L206 "View Source")

[Link to this function](#full_browser_name/1 "Link to this function")

full\_browser\_name(input)

==========================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L82 "View Source")

[Link to this function](#full_display/1 "Link to this function")

full\_display(input)

====================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L109 "View Source")

[Link to this function](#full_platform_name/1 "Link to this function")

full\_platform\_name(input)

===========================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L92 "View Source")

[Link to this function](#full_version/1 "Link to this function")

full\_version(input)

====================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L140 "View Source")

[Link to this function](#id/1 "Link to this function")

id(input)

=========

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L119 "View Source")

[Link to this function](#ie?/2 "Link to this function")

ie?(input, version \\ nil)

==========================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L383 "View Source")

[Link to this function](#ios?/2 "Link to this function")

ios?(input, version \\ nil)

===========================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L464 "View Source")

[Link to this function](#ios_version/1 "Link to this function")

ios\_version(input)

===================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L469 "View Source")

[Link to this function](#ipad?/1 "Link to this function")

ipad?(input)

============

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L331 "View Source")

[Link to this function](#iphone?/1 "Link to this function")

iphone?(input)

==============

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L327 "View Source")

[Link to this function](#ipod?/1 "Link to this function")

ipod?(input)

============

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L335 "View Source")

[Link to this function](#kindle?/1 "Link to this function")

kindle?(input)

==============

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L347 "View Source")

[Link to this function](#known?/1 "Link to this function")

known?(input)

=============

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L230 "View Source")

[Link to this function](#linux?/1 "Link to this function")

linux?(input)

=============

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L572 "View Source")

[Link to this function](#mac?/1 "Link to this function")

mac?(input)

===========

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L473 "View Source")

[Link to this function](#mac_version/1 "Link to this function")

mac\_version(input)

===================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L477 "View Source")

[Link to this function](#mac_version_name/1 "Link to this function")

mac\_version\_name(input)

=========================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L484 "View Source")

[Link to this function](#mobile?/1 "Link to this function")

mobile?(input)

==============

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L434 "View Source")

[Link to this function](#modern?/1 "Link to this function")

modern?(input)

==============

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L154 "View Source")

[Link to this function](#modern_edge?/1 "Link to this function")

modern\_edge?(ua)

=================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L167 "View Source")

[Link to this function](#modern_firefox?/1 "Link to this function")

modern\_firefox?(ua)

====================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L159 "View Source")

[Link to this function](#modern_firefox_tablet?/1 "Link to this function")

modern\_firefox\_tablet?(ua)

============================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L175 "View Source")

[Link to this function](#modern_ie_version?/1 "Link to this function")

modern\_ie\_version?(ua)

========================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L163 "View Source")

[Link to this function](#modern_opera?/1 "Link to this function")

modern\_opera?(ua)

==================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L171 "View Source")

[Link to this function](#msie_full_version/1 "Link to this function")

msie\_full\_version(input)

==========================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L409 "View Source")

[Link to this function](#msie_version/1 "Link to this function")

msie\_version(ua)

=================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L404 "View Source")

[Link to this function](#name/1 "Link to this function")

name(input)

===========

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L78 "View Source")

[Link to this function](#nintendo?/1 "Link to this function")

nintendo?(input)

================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L309 "View Source")

[Link to this function](#opera?/1 "Link to this function")

opera?(input)

=============

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L214 "View Source")

[Link to this function](#opera_mini?/1 "Link to this function")

opera\_mini?(input)

===================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L438 "View Source")

[Link to this function](#phantom_js?/1 "Link to this function")

phantom\_js?(input)

===================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L192 "View Source")

[Link to this function](#platform/1 "Link to this function")

platform(input)

===============

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L580 "View Source")

[Link to this function](#playbook?/1 "Link to this function")

playbook?(input)

================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L351 "View Source")

[Link to this function](#playstation4?/1 "Link to this function")

playstation4?(input)

====================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L305 "View Source")

[Link to this function](#playstation?/1 "Link to this function")

playstation?(input)

===================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L301 "View Source")

[Link to this function](#psp?/1 "Link to this function")

psp?(input)

===========

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L317 "View Source")

[Link to this function](#psp_vita?/1 "Link to this function")

psp\_vita?(input)

=================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L321 "View Source")

[Link to this function](#quicktime?/1 "Link to this function")

quicktime?(input)

=================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L184 "View Source")

[Link to this function](#safari?/1 "Link to this function")

safari?(input)

==============

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L196 "View Source")

[Link to this function](#safari_webapp_mode?/1 "Link to this function")

safari\_webapp\_mode?(input)

============================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L202 "View Source")

[Link to this function](#search_engine?/1 "Link to this function")

search\_engine?(input)

======================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L282 "View Source")

[Link to this function](#silk?/1 "Link to this function")

silk?(input)

============

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L222 "View Source")

[Link to this function](#surface?/1 "Link to this function")

surface?(input)

===============

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L339 "View Source")

[Link to this function](#tablet?/1 "Link to this function")

tablet?(input)

==============

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L343 "View Source")

[Link to this function](#tv?/1 "Link to this function")

tv?(input)

==========

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L595 "View Source")

[Link to this function](#uc_browser?/1 "Link to this function")

uc\_browser?(input)

===================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L218 "View Source")

[Link to this function](#version/1 "Link to this function")

version(input)

==============

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L131 "View Source")

[Link to this function](#webkit?/1 "Link to this function")

webkit?(input)

==============

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L179 "View Source")

[Link to this function](#windows10?/1 "Link to this function")

windows10?(input)

=================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L544 "View Source")

[Link to this function](#windows7?/1 "Link to this function")

windows7?(input)

================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L532 "View Source")

[Link to this function](#windows8?/1 "Link to this function")

windows8?(input)

================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L536 "View Source")

[Link to this function](#windows8_1?/1 "Link to this function")

windows8\_1?(input)

===================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L540 "View Source")

[Link to this function](#windows?/1 "Link to this function")

windows?(input)

===============

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L505 "View Source")

[Link to this function](#windows_mobile?/1 "Link to this function")

windows\_mobile?(input)

=======================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L552 "View Source")

[Link to this function](#windows_phone?/1 "Link to this function")

windows\_phone?(input)

======================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L556 "View Source")

[Link to this function](#windows_rt?/1 "Link to this function")

windows\_rt?(input)

===================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L548 "View Source")

[Link to this function](#windows_touchscreen_desktop?/1 "Link to this function")

windows\_touchscreen\_desktop?(input)

=====================================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L356 "View Source")

[Link to this function](#windows_version_name/1 "Link to this function")

windows\_version\_name(input)

=============================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L509 "View Source")

[Link to this function](#windows_vista?/1 "Link to this function")

windows\_vista?(input)

======================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L528 "View Source")

[Link to this function](#windows_wow64?/1 "Link to this function")

windows\_wow64?(input)

======================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L564 "View Source")

[Link to this function](#windows_x64?/1 "Link to this function")

windows\_x64?(input)

====================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L560 "View Source")

[Link to this function](#windows_x64_inclusive?/1 "Link to this function")

windows\_x64\_inclusive?(input)

===============================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L568 "View Source")

[Link to this function](#windows_xp?/1 "Link to this function")

windows\_xp?(input)

===================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L524 "View Source")

[Link to this function](#xbox?/1 "Link to this function")

xbox?(input)

============

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L293 "View Source")

[Link to this function](#xbox_one?/1 "Link to this function")

xbox\_one?(input)

=================

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L297 "View Source")

[Link to this function](#yandex?/1 "Link to this function")

yandex?(input)

==============

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L226 "View Source")





Browser.Ua — browser v0.5.0

 try {

 if (localStorage.getItem('night-mode') === 'true') {

 document.body.classList.add('night-mode');

 }

 } catch (error) { }

 

Browser.Ua protocol

(browser v0.5.0)

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L4 "View Source")

========================================================================================================================================

[Link to this section](#summary)

 Summary

==========================================

[Types](#types)

----------------

[t()](#t:t/0)

[ua()](#t:ua/0)

[Functions](#functions)

------------------------

[to\_ua(input)](#to_ua/1)

[Link to this section](#types)

Types

=====================================

[Link to this type](#t:t/0 "Link to this type")

t()

===

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L4 "View Source")

Specs

-----

```

t() :: [term](https://hexdocs.pm/elixir/typespecs.html#built-in-types)()

```

[Link to this type](#t:ua/0 "Link to this type")

ua()

====

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L5 "View Source")

Specs

-----

```

ua() :: [String.t](https://hexdocs.pm/elixir/String.html#t:t/0)()

```

[Link to this section](#functions)

Functions

=============================================

[Link to this function](#to_ua/1 "Link to this function")

to\_ua(input)

=============

[View Source](https://github.com/danhper/elixir-browser/blob/main/lib/browser.ex#L7 "View Source")

Specs

-----

```

to_ua([any](https://hexdocs.pm/elixir/typespecs.html#basic-types)()) :: [ua](#t:ua/0)()

```





elixir-browser — browser v0.5.0

 try {

 if (localStorage.getItem('night-mode') === 'true') {

 document.body.classList.add('night-mode');

 }

 } catch (error) { }

 

elixir-browser

 [View Source](https://github.com/danhper/elixir-browser/blob/main/README.md#L1 "View Source")

===============================================================================================================

[![Build Status](https://travis-ci.org/danhper/elixir-browser.svg?branch=master)](https://travis-ci.org/danhper/elixir-browser)

Browser detection for Elixir.

This is a port from the [Ruby browser library](https://github.com/fnando/browser).

All the detection features have been ported, but not the meta and the language ones.

 Installation

---------------

Add `browser` to your list of dependencies in `mix.exs`:

```

def deps do

 [{:browser, "~> 0.4.4"}]

end

```

 Usage

--------

```

ua = "some string"

Browser.name(ua) # readable browser name

Browser.version(ua) # major version number

Browser.full\_version(ua)

Browser.full\_browser\_name(ua) # Chrome 5.0.375.99

Browser.full\_display(ua) # example: Chrome 5.0.375.99 on MacOS 10.6.4 Snow Leopard

Browser.safari?(ua)

Browser.opera?(ua)

Browser.chrome?(ua)

Browser.chrome\_os?(ua)

Browser.mobile?(ua)

Browser.tablet?(ua)

Browser.console?(ua)

Browser.firefox?(ua)

Browser.ie?(ua)

Browser.ie?(ua, 6) # detect specific IE version

Browser.edge?(ua) # Newest MS browser

Browser.modern?(ua) # Webkit, Firefox 17+, IE 9+ and Opera 12+

Browser.platform(ua) # return :ios, :android, :mac, :windows, :linux or :other

Browser.full\_platform\_name(ua) # example: MacOS 10.6.4 Snow Leopard

Browser.device\_type(ua) # return :mobile, :tablet, :desktop, :console, :unknown

Browser.ios?(ua) # detect iOS

Browser.ios?(ua, 9) # detect specific iOS version

Browser.mac?(ua)

Browser.mac\_version(ua) # display version of Mac OSX. i.e. High Sierra

Browser.windows?(ua)

Browser.windows\_x64?(ua)

Browser.windows\_version\_name # display version of Windows. i.e. Windows 10

Browser.linux?(ua)

Browser.blackberry?(ua)

Browser.blackberry?(ua, 10) # detect specific BlackBerry version

Browser.bot?(ua)

Browser.search\_engine?(ua)

Browser.phantom\_js?(ua)

Browser.quicktime?(ua)

Browser.core\_media?(ua)

Browser.silk?(ua)

Browser.android?(ua)

Browser.android?(ua, 4.2) # detect Android Jelly Bean 4.2

Browser.known?(ua) # has the browser been successfully detected?

```

See the [original Ruby library](https://github.com/fnando/browser) for more information.

### 

 Elixir addition

You can also pass [`Plug.Conn`](https://hexdocs.pm/plug/1.13.3/Plug.Conn.html) instead of a string, the `user-agent` header will

be extracted and used.

```

Browser.bot?(conn)

```

### 

 Configuration

You can specify custom bots.txt file in your project's config.

```

config :browser,

 bots\_file: Path.join(File.cwd!, "bots.txt") # bots.txt in project's root

```

Please note that option set as mobule attribute during compile time, so make sure you recompiled elixir-browser after changing this option or bots file itself.

[← Previous Page

 

API Reference](api-reference.html)





API Reference — browser v0.5.0

 try {

 if (localStorage.getItem('night-mode') === 'true') {

 document.body.classList.add('night-mode');

 }

 } catch (error) { }

 

API Reference browser v0.5.0

=============================

 Modules

----------

[Browser](Browser.html)

[Browser.Ua](Browser.Ua.html)

[Next Page →

 

elixir-browser](readme.html)

