EN RU
Forum

Methodology

Technology

Toolbox

Libraries

Tutorials

DocumentationJSDocSource

ua

Use this block to collect data about the user's browser.

Overview

Elements of the block

Element Usage Description
svg deps Checks whether the browser supports SVG format.

Public block technologies

The block is implemented in:

  • bh.js
  • bemhtml

Description

The block enables an inline script that adds CSS classes to the <html> tag to specify whether JavaScript is enabled – ua_js_no or ua_js_yes.

It doesn't have a visual representation on the page.

Used inside the page block. You normally don't need to connect it to the page yourself.

Elements of the block

svg element

This element enables an inline script that adds CSS classes to the <html> tag to specify whether SVG is supported – ua_svg_no or ua_svg_yes.

It doesn't have a visual representation on the page.

To use it, add the element to the deps.js dependencies file for the block that needs information about SVG support:

Open in a new window

Module ua

Detect some user agent features

Object methods:

ua()
description
User agent
ios()
description
iOS version
iphone()
description
Is iPhone
ipad()
description
Is iPad
android()
description
Android version
bada()
description
Bada version
wp()
description
Windows Phone version
other()
description
Undetected platform
opera()
description
Opera version
chrome()
description
Chrome version
screenSize()
description
Screen size, one of: large, normal, small
dpr()
description
Device pixel ratio
connection()
description
Connection type, one of: wifi, 3g, 2g
flash()
description
Flash version
video()
description
Is video supported?
svg()
description
Is SVG supported?
width()
description
Viewport width
height()
description
Viewport height
landscape()
description
Is landscape oriented?

ua__dom

Use ua module to provide user agent features by modifiers and update some on orient change