Supported meta tags

Meta tags are used to control some aspects of BlackBerry Browser behavior. These tags are defined within a <meta> element of an HTML page using the following syntax.

<meta name="<meta_tag>" content="<directive>" >

The name attribute of the <meta> element is used to define the meta tag, and the content attribute specifies the directive that is used to define the browser behavior associated with the meta tag.

The BlackBerry Browser supports the following meta tags:

Meta tag

Description

BlackBerry Device Software BlackBerry Tablet OS

Meta tags used to control display behavior

HandheldFriendly

Specifies that the content is designed for small-screen devices.

The BlackBerry Browser with WebKit supports this value primarily for backwards compatibility. For BlackBerry smartphones running BlackBerry 6 or later, or for BlackBerry tablets, you should use the viewport meta tag instead.

4.6+

1.0+

viewport

Defines a set of properties that specify the behavior and initial appearance of the web page when it is displayed in the browser window.

4.6+

1.0+

Meta tags used to control event management

cursor-event-mode

Defines how the browser handles cursor events.

7.0+

1.0+

touch-event-mode

Defines how the browser handles touch events.

7.0+

1.0+

HandheldFriendly

The HandheldFriendly meta tag specifies that the content is designed for small-screen devices.

With the adoption of WebKit and the more functionally robust viewport meta tag, the HandheldFriendly tag is largely obsolete. The BlackBerry Browser with WebKit supports this value primarily for backwards compatibility. However, for BlackBerry smartphones running BlackBerry 6 or later, or for BlackBerry tablets, you should use the viewport meta tag instead. The viewport meta tag provides you greater control over the appearance and behavior of the web page.

Property

Description

true

Indicates that the content of the web page was designed for mobile devices.

false

Indicates that the content of the web page was not designed for mobile devices.

Back To Top

viewport

The viewport meta tag defines a set of properties that specify the behavior and initial appearance of the web page when it is displayed in the browser window.

The directive specified by this meta tag is a list of one or more properties, specified within a comma-separated list. All properties are optional; for any properties that are not defined, the BlackBerry Browser infers a value based on the default browser behavior. For example:

<meta name="viewport" content="width=320; initial-scale=1.0; user-scalable=no;">

The BlackBerry Browser supports the following viewport properties.

Directive properties

Description

BlackBerry Device Software BlackBerry Tablet OS

width

Specifies the width of the viewport, in pixels. This property also accepts a value of device-width constant, which enables the browser to define the viewport width based on the available screen width.

4.6+

1.0+

height

Specifies the height of the viewport, in pixels. This property also accepts a value of device-height constant, which enables the browser to define the viewport height based on the available screen height.

In practice, this property is typically unnecessary; the browser automatically defines the height based on the vertical space required to compose the layout of the content.

6.0+

1.0+

initial-scale

Specifies the scale at which the browser initially renders the viewport. The value is defined as a multiplier. A value of 2.0 means that the viewport is doubled in size and rendered at a scale of 200%.

6.0+

1.0+

maximum-scale

Specifies the maximum scale value for the viewport. The value is defined as a multiplier.

6.0+

1.0+

minimum-scale

Specifies the minimum scale value for the viewport. The value is defined as a multiplier.

6.0+

1.0+

user-scalable

Specifies whether the user can adjust the scale of the viewport. The value can be yes or no. A value of yes permits user scaling; a value of no prevents user scaling.

6.0+

1.0+

target-densitydpi

Specifies the target pixel density for which the web page is designed. This property can have one of the following values:

  • device-dpi: Specifies that the device's native pixel density should be used as the target dpi. The browser renders the content without scaling it.
  • high-dpi: Specifies that the content is intended for high-density screens. The browser scales down the content for lower-density screens as necessary.
  • medium-dpi: Specifies that the content is intended for medium-density screens. The browser scales the content up for high density screens scale up. There are no BlackBerry devices that support the target-densitydpi directive that have low density screens.
  • low-dpi: Specifies that the content is intended for low-density screens. The browser scales the content up for higher density screens as necessary.
  • dpi-value: Specifies a dpi value between 70 and 400 to use as the target dpi.

7.0+

1.0+

Back To Top

cursor-event-mode

The cursor-event-mode meta tag is used to define how the browser handles cursor events on devices with trackpads. This meta tag is supported as of BlackBerry 7.

This meta tag has the following associated directives:

Directive

Description

native

Indicates that cursor events should behave as they do in a desktop browser. Specifying this directive allows a web page to access events such as multiple or sustained trackpad clicks.

A value of native disables the following UI features:

  • click and hold to display the context menu
  • click to zoom

processed

Indicates that the browser will use the default event handling, that is, that no UI features are disabled.

Back To Top

touch-event-mode

The touch-event-mode meta tag is used to define how the browser handles touch events on devices with a touch screen. This meta tag is supported as of BlackBerry 7.

This meta tag has the following associated directives:

Directive

Description

native

Indicates that all touch events should be passed directly to the web page, without being processed by the browser UI. This directive disables the UI features that would normally consume touch events. Because touch events are passed directly to the web page without UI intervention, event lag is considerably reduced, allowing you to create content that requires fast, repetitive or complex multi-touch input.

A value of native disables the following UI features:

  • Double tap to zoom into a content block
  • Touch and hold to display the context menu
  • Two finger text selection activation on tap and hover
  • Conversion from touch events into mouse events
  • Automatic target correction
  • Scrolling, including subframe scrolling
  • Pinch-to-zoom behavior

pure-with-mouse-conversion

Indicates that some touch events should be passed directly to the web page, while others will be converted into a corresponding mouse event. This directive allows you to blend handling pure touch events with standard web content behavior, as mouse event conversion allows users to interact with standard form controls and links as they would on a desktop browser, and allows user to scroll a page. In addition, with this directive, users can still perform double taps and pinches to zoom in to the content.

If necessary, you can pre-empt the conversion to mouse events where necessary by calling the preventDefault() method. This method will disable event conversion and pass the raw touch event directly to the web page.

  • Touch and hold to display the context menu
  • Two finger text selection activation on tap and hover

processed

Indicates that the browser will use the default event handling, that is, that no UI features are disabled.

Back To Top
Next topic: Glossary
Previous topic: Supported input types

Was this information helpful? Send us your comments.