New features in this release

New user agent string

The BlackBerry® Browser for the BlackBerry® Tablet OS has an updated user agent string to enable developers to differentiate between BlackBerry tablets and BlackBerry smartphones.

The user agent string for BlackBerry Browser on BlackBerry tablets is:

Mozilla/5.0 (<BlackBerry_tablet>; U: <OS_version>; en-US) AppleWebKit/534.8+
		(KHTML, like Gecko) Version/0.0.1 Safari/534.8+
  • <BlackBerry_tablet> specifies the model of the BlackBerry tablet (for example, PlayBook)
  • <OS_version> specifies the version of the BlackBerry Tablet OS that the BlackBerry tablet is running

The browser identifies itself to servers with this string, using the User-Agent header sent with every browser request. The user agent string can also be accessed on the client side using the navigator.userAgent JavaScript® property.

Web Inspector

Web Inspector is a built-in feature of the BlackBerry® Browser that allows developers to inspect and debug their web source code. Web Inspector allows developers to inspect web content that is displayed through the browser, or in standalone applications that use the browser engine, such as BlackBerry® WebWorks™ applications. Web developers can use Web Inspector to manipulate the DOM, edit and debug JavaScript® code, analyze resource requests, and audit the performance of your web content and web applications in near real-time.

Developers can access Web Inspector functionality using a BlackBerry smartphone or BlackBerry tablet, or using a BlackBerry Smartphone Simulator or BlackBerry Tablet Simulator.

The BlackBerry Browser uses a client-server architecture to make Web Inspector functionality available to developers. The BlackBerry Browser acts as a web server. It serves the page over HTTP over a Wi-Fi® connection; developers inspect the content remotely on a desktop browser. Developers can use any WebKit-based desktop browser on the same Wi-Fi network to navigate to the IP address and port number used by the BlackBerry Browser and begin inspecting the code.

By default, Web Inspector is disabled in the browser. To use the Web Inspector, it must be in the BlackBerry Browser options. Once Web Inspector is enabled, the browser provides the IP address and port number it will use to serve the content.

Adobe Flash Player 10.1 and ActionScript 3.0

The BlackBerry® Browser on the BlackBerry® Tablet OS includes the Adobe® Flash® Player 10.1 application runtime and support forAdobe® ActionScript® 3.0, making Flash based web content accessible to BlackBerry tablet users.

Adobe Flash Player 10.1 was developed to provide the improvements in performance and the reduction in processor usage that were necessary to bring Flash content and applications to mobile devices such as smartphones and tablets. APIs have been added to ActionScript 3.0 to allow Flash applications to access some of the functionality that is unique to mobile devices, such as access to accelerometer and geolocation information and support for touch events and gesture events.

The BlackBerry Browser is capable of rendering most existing Flash content with little or no additional development effort. However, Flash to take advantage of some of the unique UI and hardware features of BlackBerry tablets, developers can create feature-rich Flash applications specifically for BlackBerry tablet users.

Access to native events

The BlackBerry® Browser now supports two new meta tags:

  • cursor-event-mode allows you to define how the browser handles events such as trackpad clicks
  • touch-event-mode allows you to define how the browser handles events such as touch screen gestures

In the past, access to certain user events was not possible from within web content because of a number of usability-related features implemented by the browser. The introduction or the cursor-event-mode and touch-event-mode meta tags allows developers to disable these UI features for a web page, so that browser passes the entire array of events to the web page.

By default, the BlackBerry Browser captures and processes most trackpad clicks or touch events at the UI level to allow for improved usability on small screens. For example, on BlackBerry devices with a trackpad, when the user clicks the track pad on an area of the content that is not a link, the browser zooms into that content block. On devices with a touch screen, users can swipe to scroll, double tap to zoom in to a content block, or touch and hold to display the context menu. In addition, on touch screen devices, most touch events are converted by the browser directly into mouse events; this behavior allows the browser to replicate the way desktop browsers manage user interaction with forms and links, but prevents web content from accessing touch events and gestures as input.

By defining event-handling behavior with the cursor-event-mode and touch-event-mode meta tags, web developers have access to the same interaction model available to Java® developers in the BlackBerry® Java® SDK. For example, web developers can track both the direction and distance of a swipe event, and respond differently based on the swipe direction or distance. Access to these events gives web developers the opportunity to create more dynamic and robust games and applications for the BlackBerry Browser.

Web Sockets API

The BlackBerry® Browser now includes support for the Web Sockets API, which is designed to permit near real-time communication with web server. A web socket is a bi-directional communication channel between a web server and a browser that allows messages to be sent back and forth without requiring an HTTP request and response each time.

The Web Socket API is designed to hide much of the complexity of socket communication. A socket is opened when a WebSocket object is constructed. Once the socket connection is established, the browser and server can send data back and forth. Once the socket is closed, it cannot be reopened; a new WebSocket objected must be constructed.

Web sockets can be an efficient solution for a web applications that require regular communication with a server. Because a web socket is established once and used repeatedly without the need for communication over HTTP, it can greatly reduce the overhead of sending multiple HTTP headers back and forth. In addition, web sockets can eliminate the need for inefficient communication practices such as polling, in which the browser checks repeatedly for new data on the server. Because a web socket is an open communication channel, the browser only needs to listen for incoming messages. When the server has new data, it sends a new message to the browser. The browser receives the message as it arrives.

Web sockets are not subject to the same-origin policy. The browser can open a socket with a server that is different from the server that originally served the web page.

By default, support for web sockets is disabled in the BlackBerry Browser. To establish a web socket between the browser and a server, the user must first select the Enable Web Sockets setting in the BlackBerry Browser options. Because this technology is dependent upon a user setting, web developers should provide alternate content in the event that web sockets are not available.

Embedded media

The BlackBerry® Browser now includes full support for HTML 5 embedded media, excluding the <track> element.

The embedded media feature of HTML 5 includes:
  • the <audio> and <video> elements, which let you embed audio or video into your content without the need for a plug-in
  • the <source> element , which lets you specify a media resource; multiple <source> elements can be included to specify a prioritized list of media resources
  • a scripting API that lets you control playback
  • a set of media-related events

Using <audio> or <video> elements to embed media into your content allows the media to be played within the web content without requiring a third-party plug-in, and without opening the file in the Media application and hiding the web page. Developers can also access and manipulate embedded media through the DOM using JavaScript® and CSS.

Next topic: Related resources
Previous topic: Overview

Was this information helpful? Send us your comments.