Namespaces
Variants
Actions

Browser Control API/CBrCtlInterface PageInfoLC workaround

Jump to: navigation, search

A bug was introduced into CBrCtlInterface::PageInfoLC in Belle FP2. When querying some values that the function is supposed to return, nothing is returned and a NULL is left on cleanup stack.

This page shows workaround for constructing User Agent string by hand.

Code

_LIT(KBellleFP2BrowserVersion,"8.3");
_LIT(KBrowser83UserAgent,"Mozilla/5.0 (Symbian/3; Series60/5.5 Nokia701/113.010.1506; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/535.1 (KHTML, like Gecko) NokiaBrowser/8.3.2.21 Mobile Safari/535.1 3gpp-gba");
HBufC* browserVersion = iBrCtlInterface->VersionInfoLC(TBrCtlDefs::EBrowserVersion);
HBufC* pageInfoContent = NULL;
if(browserVersion)
{
if (browserVersion->Des().Find(KBellleFP2BrowserVersion)!=KErrNotFound)
{
//use hard code User agent
pageInfoContent = KBrowser83UserAgent().AllocLC();
iEikonEnv->InfoMsg(_L("Using HardCoded user agent"));
}
else
{
// use TBrCtlDefs::EPageInfoContent
pageInfoContent = iBrCtlInterface->PageInfoLC(TBrCtlDefs::EPageInfoContent);
iEikonEnv->InfoMsg(_L("Retriving from PageInfoLC"));
}
}
CleanupStack::PopAndDestroy(2); // browserVersion,pageInfoContent


Article Metadata

Compatibility
Platform(s): Nokia Belle FP2

Article
Created: ppaadar (25 Oct 2012)
Last edited: hamishwillee (26 Oct 2012)
102 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved