User-Agent of my app same as native Symbian web browser



  • Hi,
    I would like to set User-Agent in HTTP header of my application to same as native one of Symbian Web browser.
    Is it possible?

    User-Agent of native web browser for my C7 is following:
    Mozilla/5.0 (Symbian/3; Series60/5.2 NokiaC7-00/022.014; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/533.4 (KHTML, like Gecko) NokiaBrowser/7.3.1.37 Mobile Safari/533.4 3gpp-gba

    User-Agent for my C7 is retrived using QWebPage::userAgentForUrl:
    Mozilla/5.0 (Symbian/3; U; C7-00; en-GB) AppleWebKit/534.3 (KHTML, like Gecko) Qt/4.7.3 Mobile Safari/534.3

    In above string I replace part: U; C7-00; en-GB) with data extracted using QSysInfo::s60Version (). I switch case it similarly as it is done in QWebPage::userAgentForUrl and I get Series60/5.2. With QSystemDeviceInfo::manufacturer() and QSystemDeviceInfo::model() I get NokiaC7-00. At the end after / I add QSystemDeviceInfo::productName().

    After transformation my User-Agent is following:
    Mozilla/5.0 (Symbian/3; Series60/5.2 NokiaC7-00/RM-675 ) AppleWebKit/534.3 (KHTML, like Gecko) Qt/4.7.3 Mobile Safari/534.3

    It is quite OK and phone is recognized, however I wonder if this approach is OK?
    What will happen on different models, eg Nokia N8, XP 5800; and what will happen after Symbian update?
    I would appreciate any comments, opinions and suggestions.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.