Hi, wondering if anyone knows how to get at browser info from within
Seaside? In .Net the web server captures a bunch of information in Server.ServerVariables dictionary, most of that stuff I can find in HttpRequest, I can find the referrer, user-agent, and host, but I need the screen resolution. I need to deliver a different css stylesheet depending on the users screen resolution and can't seem to find anything that'll work. _______________________________________________ Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Ramon Leon wrote:
> Hi, wondering if anyone knows how to get at browser info from within > Seaside? In .Net the web server captures a bunch of information in > Server.ServerVariables dictionary, most of that stuff I can find in > HttpRequest, I can find the referrer, user-agent, and host, but I need > the screen resolution. I need to deliver a different css stylesheet > depending on the users screen resolution and can't seem to find anything > that'll work. I don't think navigators return this by default. You might want to ask using javascript... just a clue, sorry _______________________________________________ Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
But since the web server is also a smalltalk object, he would have this
information, right? Seems terribly inefficient to have to generate javascript to find out the browser when the smalltalk system already knows what it is talking to. -----Ursprüngliche Nachricht----- Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Damien Cassou Gesendet: Dienstag, 15. August 2006 17:39 An: The Squeak Enterprise Aubergines Server - general discussion. Betreff: Re: [Seaside] Browser Information Ramon Leon wrote: > Hi, wondering if anyone knows how to get at browser info from within > Seaside? In .Net the web server captures a bunch of information in > Server.ServerVariables dictionary, most of that stuff I can find in > HttpRequest, I can find the referrer, user-agent, and host, but I need > the screen resolution. I need to deliver a different css stylesheet > depending on the users screen resolution and can't seem to find anything > that'll work. I don't think navigators return this by default. You might want to ask using javascript... just a clue, sorry _______________________________________________ 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 |
self session currentRequest headerAt: 'user-agent'
Hope this helps, -Boris -- +1.604.689.0322 DeepCove Labs Ltd. 4th floor 595 Howe Street Vancouver, Canada V6C 2T5 [hidden email] CONFIDENTIALITY NOTICE This email is intended only for the persons named in the message header. Unless otherwise indicated, it contains information that is private and confidential. If you have received it in error, please notify the sender and delete the entire message including any attachments. Thank you. -----Original Message----- From: [hidden email] [mailto:[hidden email]] On Behalf Of Jason Johnson Sent: Wednesday, August 16, 2006 10:57 AM To: 'The Squeak Enterprise Aubergines Server - general discussion.' Subject: AW: [Seaside] Browser Information But since the web server is also a smalltalk object, he would have this information, right? Seems terribly inefficient to have to generate javascript to find out the browser when the smalltalk system already knows what it is talking to. -----Ursprüngliche Nachricht----- Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Damien Cassou Gesendet: Dienstag, 15. August 2006 17:39 An: The Squeak Enterprise Aubergines Server - general discussion. Betreff: Re: [Seaside] Browser Information Ramon Leon wrote: > Hi, wondering if anyone knows how to get at browser info from within > Seaside? In .Net the web server captures a bunch of information in > Server.ServerVariables dictionary, most of that stuff I can find in > HttpRequest, I can find the referrer, user-agent, and host, but I need > the screen resolution. I need to deliver a different css stylesheet > depending on the users screen resolution and can't seem to find anything > that'll work. I don't think navigators return this by default. You might want to ask using javascript... just a clue, sorry _______________________________________________ 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 _______________________________________________ Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside smime.p7s (4K) Download Attachment |
In reply to this post by Jason Johnson-3
Jason Johnson wrote:
> But since the web server is also a smalltalk object, he would have this > information, right? Seems terribly inefficient to have to generate > javascript to find out the browser when the smalltalk system already > knows what it is talking to. I agree.. I'd be willing to bet this is down in the bowels somewhere -- its probably just an issue of finding it and (if needed) adding a method to make it available to the caller. Perhaps Michel might know? I'd personally hope that all of that sort of information is available besides the more obvious items -- surely someone will eventually be interested in reviewing that information for some reason or another.. Just my $2 worth.. (which ain't much these days!) _______________________________________________ Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by Boris Popov, DeepCove Labs (SNN)
Answers my question. Thanks.
-----Ursprüngliche Nachricht----- Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Boris Popov Gesendet: Mittwoch, 16. August 2006 20:05 An: The Squeak Enterprise Aubergines Server - general discussion. Betreff: RE: [Seaside] Browser Information self session currentRequest headerAt: 'user-agent' Hope this helps, -Boris -- +1.604.689.0322 DeepCove Labs Ltd. 4th floor 595 Howe Street Vancouver, Canada V6C 2T5 [hidden email] CONFIDENTIALITY NOTICE This email is intended only for the persons named in the message header. Unless otherwise indicated, it contains information that is private and confidential. If you have received it in error, please notify the sender and delete the entire message including any attachments. Thank you. -----Original Message----- From: [hidden email] [mailto:[hidden email]] On Behalf Of Jason Johnson Sent: Wednesday, August 16, 2006 10:57 AM To: 'The Squeak Enterprise Aubergines Server - general discussion.' Subject: AW: [Seaside] Browser Information But since the web server is also a smalltalk object, he would have this information, right? Seems terribly inefficient to have to generate javascript to find out the browser when the smalltalk system already knows what it is talking to. -----Ursprüngliche Nachricht----- Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Damien Cassou Gesendet: Dienstag, 15. August 2006 17:39 An: The Squeak Enterprise Aubergines Server - general discussion. Betreff: Re: [Seaside] Browser Information Ramon Leon wrote: > Hi, wondering if anyone knows how to get at browser info from within > Seaside? In .Net the web server captures a bunch of information in > Server.ServerVariables dictionary, most of that stuff I can find in > HttpRequest, I can find the referrer, user-agent, and host, but I need > the screen resolution. I need to deliver a different css stylesheet > depending on the users screen resolution and can't seem to find anything > that'll work. I don't think navigators return this by default. You might want to ask using javascript... just a clue, sorry _______________________________________________ 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 _______________________________________________ Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by Rick Flower
Its not *that* bad and is surely useful in many cases, see my previous email
to the list ;) Cheers! -Boris -- +1.604.689.0322 DeepCove Labs Ltd. 4th floor 595 Howe Street Vancouver, Canada V6C 2T5 [hidden email] CONFIDENTIALITY NOTICE This email is intended only for the persons named in the message header. Unless otherwise indicated, it contains information that is private and confidential. If you have received it in error, please notify the sender and delete the entire message including any attachments. Thank you. -----Original Message----- From: [hidden email] [mailto:[hidden email]] On Behalf Of Rick Flower Sent: Wednesday, August 16, 2006 11:04 AM To: The Squeak Enterprise Aubergines Server - general discussion. Subject: Re: AW: [Seaside] Browser Information Jason Johnson wrote: > But since the web server is also a smalltalk object, he would have this > information, right? Seems terribly inefficient to have to generate > javascript to find out the browser when the smalltalk system already > knows what it is talking to. I agree.. I'd be willing to bet this is down in the bowels somewhere -- its probably just an issue of finding it and (if needed) adding a method to make it available to the caller. Perhaps Michel might know? I'd personally hope that all of that sort of information is available besides the more obvious items -- surely someone will eventually be interested in reviewing that information for some reason or another.. Just my $2 worth.. (which ain't much these days!) _______________________________________________ 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 smime.p7s (4K) Download Attachment |
In reply to this post by Jason Johnson-3
Jason Johnson wrote:
> But since the web server is also a smalltalk object, he would have this > information, right? Seems terribly inefficient to have to generate > javascript to find out the browser when the smalltalk system already > knows what it is talking to. I'm not an expert, this is only what I think happens and you may want to wait for a more precise answer. - Theoretically, the webserver does not have to know the type of client it talks to. The client ask for a page sending and url, and the webserver answers a content. No need to know who is asking. - In practice, here is what a navigator send to a webserver (extracted from the variable request in HttpAdaptator>>beginConversation): URL=/seaside/config; protocol=HTTP/1.1; 'accept'->'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5' 'accept-charset'->'ISO-8859-1,utf-8;q=0.7,*;q=0.7' 'accept-encoding'->'gzip,deflate' 'accept-language'->'fr-fr,en-gb;q=0.7,en;q=0.3' 'connection'->'keep-alive' 'host'->'localhost:8080' 'keep-alive'->'300' 'user-agent'->'Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.8.0.5) Gecko/20060731 Ubuntu/dapper-security Firefox/1.5.0.5' What is important for us is the last two lines. You can see that the user-agent is filled with information about the version, the operating system and other things like this. This information can easily be used in your application. But the question of Ramon wasn't about browser but about screen resolution. As you can see, this information is not in the request. The webserver doesn't know it and your application can't know it too... unless the browser sends it. And that is the solution I proposed when I say to send it using javascript. I think javascript can access this information. With the information on the client side, you need to send it to the webserver and then, you will be able to access it from your component. Hope it is clearer now -- Damien Cassou _______________________________________________ Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by Boris Popov, DeepCove Labs (SNN)
Yeah, but this is totally unspecified (or no browser follows the
specification), not reliable and bad practice. Additionally it doesn't provide the screen resolution as initially asked. Philippe 2006/8/16, Boris Popov <[hidden email]>: > self session currentRequest headerAt: 'user-agent' > > Hope this helps, > > -Boris > > -- > +1.604.689.0322 > DeepCove Labs Ltd. > 4th floor 595 Howe Street > Vancouver, Canada V6C 2T5 > > [hidden email] > > CONFIDENTIALITY NOTICE > > This email is intended only for the persons named in the message > header. Unless otherwise indicated, it contains information that is > private and confidential. If you have received it in error, please > notify the sender and delete the entire message including any > attachments. > > Thank you. > > -----Original Message----- > From: [hidden email] > [mailto:[hidden email]] On Behalf Of Jason > Johnson > Sent: Wednesday, August 16, 2006 10:57 AM > To: 'The Squeak Enterprise Aubergines Server - general discussion.' > Subject: AW: [Seaside] Browser Information > > But since the web server is also a smalltalk object, he would have this > information, right? Seems terribly inefficient to have to generate > javascript to find out the browser when the smalltalk system already > knows what it is talking to. > > -----Ursprüngliche Nachricht----- > Von: [hidden email] > [mailto:[hidden email]] Im Auftrag von > Damien Cassou > Gesendet: Dienstag, 15. August 2006 17:39 > An: The Squeak Enterprise Aubergines Server - general discussion. > Betreff: Re: [Seaside] Browser Information > > Ramon Leon wrote: > > Hi, wondering if anyone knows how to get at browser info from within > > Seaside? In .Net the web server captures a bunch of information in > > Server.ServerVariables dictionary, most of that stuff I can find in > > HttpRequest, I can find the referrer, user-agent, and host, but I need > > > the screen resolution. I need to deliver a different css stylesheet > > depending on the users screen resolution and can't seem to find > anything > > that'll work. > > I don't think navigators return this by default. You might want to ask > using javascript... just a clue, sorry > _______________________________________________ > 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 > > > _______________________________________________ > 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 |
Indeed, nowhere will you find screen resolution in there, but user agent is
actually used quite a bit in real world even though its not a mandatory regulated field. That's not to say I would recommend relying on it, but its available should you need that knowledge for whatever reason (http://en.wikipedia.org/wiki/User_agent). Back to resolution issue, you should be able to use scriptaculous to place an async request on the home page that sends back, screen.width+'@'+screen.height to a callback, which you can then use to set the resolution on your session and refer to it from there on in. I'll see if I can find a few minutes to try to provide a working example. Cheers! -Boris -- +1.604.689.0322 DeepCove Labs Ltd. 4th floor 595 Howe Street Vancouver, Canada V6C 2T5 [hidden email] CONFIDENTIALITY NOTICE This email is intended only for the persons named in the message header. Unless otherwise indicated, it contains information that is private and confidential. If you have received it in error, please notify the sender and delete the entire message including any attachments. Thank you. -----Original Message----- From: [hidden email] [mailto:[hidden email]] On Behalf Of Philippe Marschall Sent: Wednesday, August 16, 2006 11:21 AM To: The Squeak Enterprise Aubergines Server - general discussion. Subject: Re: [Seaside] Browser Information Yeah, but this is totally unspecified (or no browser follows the specification), not reliable and bad practice. Additionally it doesn't provide the screen resolution as initially asked. Philippe 2006/8/16, Boris Popov <[hidden email]>: > self session currentRequest headerAt: 'user-agent' > > Hope this helps, > > -Boris > > -- > +1.604.689.0322 > DeepCove Labs Ltd. > 4th floor 595 Howe Street > Vancouver, Canada V6C 2T5 > > [hidden email] > > CONFIDENTIALITY NOTICE > > This email is intended only for the persons named in the message > header. Unless otherwise indicated, it contains information that is > private and confidential. If you have received it in error, please > notify the sender and delete the entire message including any > attachments. > > Thank you. > > -----Original Message----- > From: [hidden email] > [mailto:[hidden email]] On Behalf Of Jason > Johnson > Sent: Wednesday, August 16, 2006 10:57 AM > To: 'The Squeak Enterprise Aubergines Server - general discussion.' > Subject: AW: [Seaside] Browser Information > > But since the web server is also a smalltalk object, he would have this > information, right? Seems terribly inefficient to have to generate > javascript to find out the browser when the smalltalk system already > knows what it is talking to. > > -----Ursprüngliche Nachricht----- > Von: [hidden email] > [mailto:[hidden email]] Im Auftrag von > Damien Cassou > Gesendet: Dienstag, 15. August 2006 17:39 > An: The Squeak Enterprise Aubergines Server - general discussion. > Betreff: Re: [Seaside] Browser Information > > Ramon Leon wrote: > > Hi, wondering if anyone knows how to get at browser info from within > > Seaside? In .Net the web server captures a bunch of information in > > Server.ServerVariables dictionary, most of that stuff I can find in > > HttpRequest, I can find the referrer, user-agent, and host, but I need > > > the screen resolution. I need to deliver a different css stylesheet > > depending on the users screen resolution and can't seem to find > anything > > that'll work. > > I don't think navigators return this by default. You might want to ask > using javascript... just a clue, sorry > _______________________________________________ > 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 > > > _______________________________________________ > Seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > > > > [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 smime.p7s (4K) Download Attachment |
> -----Original Message-----
> From: [hidden email] > [mailto:[hidden email]] On Behalf > Of Boris Popov > Sent: Wednesday, August 16, 2006 11:41 AM > To: The Squeak Enterprise Aubergines Server - general discussion. > Subject: RE: [Seaside] Browser Information > > Indeed, nowhere will you find screen resolution in there, but > user agent is actually used quite a bit in real world even > though its not a mandatory regulated field. That's not to say > I would recommend relying on it, but its available should you > need that knowledge for whatever reason > (http://en.wikipedia.org/wiki/User_agent). > > Back to resolution issue, you should be able to use > scriptaculous to place an async request on the home page that > sends back, > > screen.width+'@'+screen.height > > to a callback, which you can then use to set the resolution > on your session and refer to it from there on in. I'll see if > I can find a few minutes to try to provide a working example. > > Cheers! > > -Boris Nah, there's no good reliable way to get screen res in any framework without JavaScript, and frankly, JavaScript is not a good solution. The real problem was the approach, which I've changed. I was trying to accommodate a designer, I told him to make a better style sheet that works for all resolutions, end of problem. _______________________________________________ Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Heh, good one there. I wondered about that, but figured there must be a good
reason for it :) -Boris -- +1.604.689.0322 DeepCove Labs Ltd. 4th floor 595 Howe Street Vancouver, Canada V6C 2T5 [hidden email] CONFIDENTIALITY NOTICE This email is intended only for the persons named in the message header. Unless otherwise indicated, it contains information that is private and confidential. If you have received it in error, please notify the sender and delete the entire message including any attachments. Thank you. -----Original Message----- From: [hidden email] [mailto:[hidden email]] On Behalf Of Ramon Leon Sent: Wednesday, August 16, 2006 11:52 AM To: 'The Squeak Enterprise Aubergines Server - general discussion.' Subject: RE: [Seaside] Browser Information > -----Original Message----- > From: [hidden email] > [mailto:[hidden email]] On Behalf > Of Boris Popov > Sent: Wednesday, August 16, 2006 11:41 AM > To: The Squeak Enterprise Aubergines Server - general discussion. > Subject: RE: [Seaside] Browser Information > > Indeed, nowhere will you find screen resolution in there, but > user agent is actually used quite a bit in real world even > though its not a mandatory regulated field. That's not to say > I would recommend relying on it, but its available should you > need that knowledge for whatever reason > (http://en.wikipedia.org/wiki/User_agent). > > Back to resolution issue, you should be able to use > scriptaculous to place an async request on the home page that > sends back, > > screen.width+'@'+screen.height > > to a callback, which you can then use to set the resolution > on your session and refer to it from there on in. I'll see if > I can find a few minutes to try to provide a working example. > > Cheers! > > -Boris JavaScript, and frankly, JavaScript is not a good solution. The real problem was the approach, which I've changed. I was trying to accommodate a designer, I told him to make a better style sheet that works for all resolutions, end of problem. _______________________________________________ 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 smime.p7s (4K) Download Attachment |
In reply to this post by Ramon Leon-4
Hi!
Ramon Leon <[hidden email]> wrote: > Hi, wondering if anyone knows how to get at browser info from within > Seaside? In .Net the web server captures a bunch of information in > Server.ServerVariables dictionary, most of that stuff I can find in > HttpRequest, I can find the referrer, user-agent, and host, but I need > the screen resolution. I need to deliver a different css stylesheet > depending on the users screen resolution and can't seem to find anything > that'll work. Also note that using the unit "em" makes your stylesheets "resolution aware" in a sense. AFAIK it is the recommended unit for font sizing for example. regards, Göran _______________________________________________ Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by Damien Cassou-3
Yes, you're right of course. Not sure how I missed it. But in any case
I wanted to know how to get the user agent stuff. :) -----Ursprüngliche Nachricht----- Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Damien Cassou Gesendet: Mittwoch, 16. August 2006 20:20 An: The Squeak Enterprise Aubergines Server - general discussion. Betreff: Re: AW: [Seaside] Browser Information But the question of Ramon wasn't about browser but about screen resolution. As you can see, this information is not in the request. The webserver doesn't know it and your application can't know it too... unless the browser sends it. And that is the solution I proposed when I say to send it using javascript. I think javascript can access this information. With the information on the client side, you need to send it to the webserver and then, you will be able to access it from your component. Hope it is clearer now -- Damien Cassou _______________________________________________ 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 |
Free forum by Nabble | Edit this page |