BlackBerry® developers can use the Web Inspector utility to help to debug and profile web application content running on a BlackBerry® PlayBook™ tablet. I discussed this earlier in a blog post entitled “Debugging BlackBerry web applications using Web Inspector,” and BlackBerry remains the only mobile development platform in the market with this feature. This powerful debugging tool can be used to test and troubleshoot HTML5 content, running either in the browser or within an application created using the BlackBerry® WebWorks™ SDK. Instructions about how to debug BlackBerry web applications using Web Inspector can be found in developer support documentation.
The BlackBerry® PlayBook™ OS 2.0 software upgrade provided major enhancements to the web developer platform, and I wanted to highlight some of the key improvements to Web Inspector that are now available in OS 2.0 as well. These enhancements can make it easier for developers to fix bugs, improve performance and create positive experiences for their users.
Quick access settings menu
A settings panel is now available to help developers configure how information is presented within Web Inspector. Developers can define default formats for colors, text indentation and word wrap behavior.
The new networking panel displays helpful information about HTTP request and responses made by your application. This includes network traffic logging about documents, style sheets, images, scripts, XmlHttpRequest, fonts and even web sockets.
Click on any resource displayed on the left side panel to view its request and response HTTP headers as well as a preview of the actual resource.
Right-clicking on any panel in Web Inspector will now display a new context menu. This menu contains items that are relevant to the current window. For example, within the “Elements” panel developers can edit or copy selected HTML elements, while in the Network panel, developers can copy link addresses as well as HTTP request and response headers.
Console window auto-complete
Custom User Agent
Web Inspector can now be used to change the value of the user agent header. This header is often used by web servers to detect which browser is currently being used to access a web page, and provide custom content targeted to that browser. Open up the settings window and select the “Override User Agent” checkbox. You can then select from a list of default user agent values, or provide your own.
See the “How to detect the BlackBerry Browser” developer article for more information about the format of the user agent header on the BlackBerry web platform.
Don’t forget to use Web Inspector as part of developing and testing your HTML5 and BlackBerry WebWorks applications. It can save you a lot of time and frustration in tracking down a bug, or finding ways to optimize your web content.
Try it out for yourself, and let us know how it helps with your BlackBerry development.