User-Agent on Mac

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
kunicki
Posts: 12
Joined: Wed Mar 10, 2010 2:28 pm

User-Agent on Mac

Post by kunicki » Sat Apr 24, 2010 4:22 pm

I am using revBrowser on a card on the Mac. It points to Google Calendar. Apparently google calendar tests if the browser is supported and then displays a popup message to the user if it isnt. It is a message box with a OK and Cancel button. Interestingly Revolution opens with this dialogue. I am assuming Revolution uses some form of custom USER-AGENT.

However, I do know that the calendar works just fine in safari. I would like to bypass this message if at all possible. Is there a way to modify the USER-AGENT to just use the embedded browsers user agent?

Thanks

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: User-Agent on Mac

Post by Klaus » Sun Apr 25, 2010 12:00 pm

Hi kunicki,

you can set "the httpheaders" before going to a website (revBrowserNavigate)!
Check the Docs (Rev Dictionary) for further info.


Best

Klaus

kunicki
Posts: 12
Joined: Wed Mar 10, 2010 2:28 pm

Re: User-Agent on Mac

Post by kunicki » Sun Apr 25, 2010 4:04 pm

Klaus,

Thanks for your help. I am not researching this. Though something is unclear. Do you know if these command also apply when revBrowser is used? The docs mention: "Whenever Revolution contacts a web server (with the load command, the post command, or by using an http URL in an expression), the headersList is sent to the web server."

I am curious if revBrowser is using the same plumbing or possibly just making an instance of webkit and loading a url into it.

Any thoughts?

RRobert
Posts: 151
Joined: Sat Feb 28, 2009 8:20 pm

Re: User-Agent on Mac

Post by RRobert » Sun Apr 25, 2010 5:31 pm

If you use the revBrowser external then the user agent string of the browser will be used. This should have nothing to do with changing the user agent string in the http header by the httpheaders property which refers to the internet library.

You could check the user agent string by a three lines php script:

useragent.php

Code: Select all

<?php
echo $_SERVER["HTTP_USER_AGENT"]
?>
Robert
Last edited by RRobert on Sun Apr 25, 2010 7:57 pm, edited 4 times in total.

kunicki
Posts: 12
Joined: Wed Mar 10, 2010 2:28 pm

Re: User-Agent on Mac

Post by kunicki » Sun Apr 25, 2010 5:39 pm

Well, Ok, you are right about that. revBrowser on the mac is reporting:

--> Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us) AppleWebKit/531.22.7 (KHTML, like Gecko)

If I use Safari I get:

--> Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us) AppleWebKit/531.22.7 (KHTML, like Gecko) Version/4.0.5 Safari/531.22.7

That small difference is a big difference since the website is checking for Safari or Chrome.

All I need to do is append that last detail! But I don't see a way with revBrowser.

RRobert
Posts: 151
Joined: Sat Feb 28, 2009 8:20 pm

Re: User-Agent on Mac

Post by RRobert » Sun Apr 25, 2010 5:42 pm

Sorry I did not noticed the small difference.

Looks like it's a bug: http://quality.runrev.com/qacenter/show_bug.cgi?id=5872

Edit: I also read that Klaus is right, it should work well under windows with the httpheaders property.

Edit2: WebKit offers the option to set a custom user agent via setCustomUserAgent.

Robert

kunicki
Posts: 12
Joined: Wed Mar 10, 2010 2:28 pm

Re: User-Agent on Mac

Post by kunicki » Sun Apr 25, 2010 9:11 pm

Robert,

Thanks you have gone beyond the call of duty trying to help. I can't imagine there is some way with rev to send setCustomUserAgent message to the UIWebView? I know how to do this in Objective-C but I am not sure this can help me here. Were just mentioning it as a solution to the bug or is there some way to do this in rev?

Cheers,
K

RRobert
Posts: 151
Joined: Sat Feb 28, 2009 8:20 pm

Re: User-Agent on Mac

Post by RRobert » Sun Apr 25, 2010 10:29 pm

A workaround would maybe to use a http proxy like Squid and change the user agent string there.

Robert

Post Reply