Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.
Browser Control API/CBrCtlInterface PageInfoLC workaround
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.
_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/126.96.36.199 Mobile Safari/535.1 3gpp-gba");
HBufC* browserVersion = iBrCtlInterface->VersionInfoLC(TBrCtlDefs::EBrowserVersion);
HBufC* pageInfoContent = NULL;
//use hard code User agent
pageInfoContent = KBrowser83UserAgent().AllocLC();
iEikonEnv->InfoMsg(_L("Using HardCoded user agent"));
// use TBrCtlDefs::EPageInfoContent
pageInfoContent = iBrCtlInterface->PageInfoLC(TBrCtlDefs::EPageInfoContent);
iEikonEnv->InfoMsg(_L("Retriving from PageInfoLC"));
CleanupStack::PopAndDestroy(2); // browserVersion,pageInfoContent