[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details

How to change User-Agent string on Symbian mobile?

Asked by symbian-user in Symbian Handheld Operating System, CodeWarrior, JavaScript

Tags: Symbian User-Agent change How to mobile, HTML, XMLHttpRequest, Symbian, User-Agent, setRequestHeader, mobile, C++, javascript

I want to get html page from server with modified user-agent...  Any ideas please...))) i have found one solution http://www.youtube.com/watch?v=qr1T9fze_f4 but it is only for cracked mobiles...and needed restart mobile or brouser((( Also i have tried to create XMLHttpRequest and then setRequestHeader("User-Agent",...) but in fact it doesn't change user-agent string((((((((
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
<script type="text/javascript" language="javascript">
function createRequest() {
...
}
 
function loadHttpRequest(url) {
//This code works fine on WIndows but on Symbian emulator doesn't change User-Agent string
        try {
              var xmlhttp = createRequest();
              xmlhttp.open("GET", "http://ip.xss.ru/header.php", true);
 
              xmlhttp.onreadystatechange = function() {
               if (xmlhttp.readyState == 4) {
                    try {
                        if (!xmlhttp.status || xmlhttp.status == 200) {
                            alert("Navigate complete:\r\n" + xmlhttp.responseText);
                            document.write(xmlhttp.responseText);
                        }
                    } catch (e) {
                        alert(e.message || e);
                    }
                }
            };//onreadystatechange
           
            xmlhttp.setRequestHeader("User-Agent", "Test Agent String");
            xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
            
            xmlhttp.send(null);
        } catch (e) {
            alert(e.message || e);
        }
}
</script>
 
Related Solutions
Keywords: How to change User-Agent string on …
 
Loading Advertisement...
 
[+][-]08/20/09 07:17 AM, ID: 25142795Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/15/09 12:52 AM, ID: 25332672Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091118-EE-VQP-93 - Hierarchy / EE_QW_3_20080625