Browser information

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Browser information

Long Haired David
I am using Seaside 3.0 on VAST Smalltalk/Windows.

 I need to be able to distinguish between a page being rendered on an iPad or on a standard browser. How do I get that sort of information?

As I am working on an internal network, knowing the IP address would be sufficient for my needs.

Thanks in advance.

David


Message sent using Winmail Mail Server

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
David
Totally Objects
Doing Smalltalk since 1989
Reply | Threaded
Open this post in threaded view
|

Re: Browser information

Johan Brichau-2
Hi David,

This is info that is being sent along with the request headers.
In Seaside, you can access the WARequest instance with “self requestContext request”.

The info you are looking for is in the 'User-Agent’ header.
The source IP is in there as well, but I don’t know that header name by heart.

Hope this gets you on your way
Johan

> On 12 Nov 2014, at 16:39, David Pennington <[hidden email]> wrote:
>
> I am using Seaside 3.0 on VAST Smalltalk/Windows.
>
>  I need to be able to distinguish between a page being rendered on an iPad or on a standard browser. How do I get that sort of information?
>
> As I am working on an internal network, knowing the IP address would be sufficient for my needs.
>
> Thanks in advance.
>
> David
>
> Message sent using Winmail Mail Server
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Browser information

Philippe Marschall
On Wed, Nov 12, 2014 at 5:02 PM, Johan Brichau <[hidden email]> wrote:
> Hi David,
>
> This is info that is being sent along with the request headers.
> In Seaside, you can access the WARequest instance with “self requestContext request”.
>
> The info you are looking for is in the 'User-Agent’ header.
> The source IP is in there as well, but I don’t know that header name by heart.

The selector is #userAgent. If you're behind a reverse proxy the
headers are 'x-forwarded-for' or 'forwarded-for' depending on the
server.

Note the user agent string is horribly underspecified.

Cheers
Philippe
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside