Browser Detection?

Forum to discuss the Web client version of Servoy.

Browser Detection?

Postby chartpacs » Wed Sep 20, 2006 12:37 am

Hello,

Is it possible to detect the browser (user agent) that's connected? The reason I'd like to do this is for browsers on mobile clients (like Blazer on Palms). I'd like to show one form for mobile clients and another for "regular" browsers. I've looked at application.getApplicationType(), but I don't think that will help. I guess I'm looking for getUserAgentString().
Regards,
Servoy Developer
Version 3.1 beta2-build 401
Java version 1.5.0_06-64, Mac OS X 10.4.8
User avatar
chartpacs
 
Posts: 188
Joined: Wed May 10, 2006 6:50 pm
Location: Cleveland, OH

Postby IT2Be » Wed Sep 20, 2006 8:46 am

Can you find these settings in the system properties? If so I might be able to add a function to the tools plugin...
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby pbakker » Wed Sep 20, 2006 8:55 am

Marcel, can you access the environment where the WebClient is running in through a plugin? My understanding is that the context of the java environment for Webclients is the virtual client that is running on the server. So in that respect, I don't think it's possible to retrieve info regarding which browser is used. (but then again: I might be wrong...)

Regarding the ability to get the make and version of the browser used for the WebClient: I allready put in a feature request for that in the support system. Servoy has looked at it and responded that it will not make it into 3.0, but might make it into 3.1

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby IT2Be » Wed Sep 20, 2006 9:03 am

Hmm, I didn't realize we were talking webclient... Yet another thing to report (and/or ask for) when asking/answering questions I guess...

To be honest I don't know that but one the other hand it should be possible to ask for it in the code shouldn't it? Maybe sending some javascipt DOM function? Just thinking out loud, no real 'fundament' for the thought here...
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby pbakker » Wed Sep 20, 2006 9:17 am

Well, I guess we're tsalking WC, because we're talking about the userAgent and the browser...

Maybe somwhow you can access the WC clientside somehow, but I don't think the exposed API offers that ability.

Allthough not completely sure, but I think it's also not really possible to "talk" from the server to the WC clientside (so the part running in the browser, not the part running on the server).

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby chartpacs » Wed Sep 20, 2006 12:53 pm

Hello,

Yeah, I was referring to the webclient, not the headless client. Sorry if that was unclear (this is the Webclient forum though :wink: ) . For the mobile web browsers I need a simplified version of a given form, so I was just wondering how to distinguish, for example, Firefox from the Palm Blazer browser. Paul, thanks for the update. ::crossing fingers:: Let's hope this feature makes it into 3.1.
Regards,
Servoy Developer
Version 3.1 beta2-build 401
Java version 1.5.0_06-64, Mac OS X 10.4.8
User avatar
chartpacs
 
Posts: 188
Joined: Wed May 10, 2006 6:50 pm
Location: Cleveland, OH

Re: Browser Detection?

Postby jt » Thu Sep 24, 2009 5:10 pm

Does anyone know if this feature was ever implemented? It would be very useful to know which browser a user was using.

TIA, J T
J T Young
TMASystems
-------------------------------------------------------------------
Servoy Developer
Version 5.2.4, Build 1006
Java version 1.6.0_21 (Windows Vista)
SQL Server 2005 SP3/Oracle 10g R2
jt
 
Posts: 30
Joined: Sat May 05, 2007 10:17 pm
Location: Tulsa, Oklahoma

Re: Browser Detection?

Postby pbakker » Thu Sep 24, 2009 5:32 pm

No, there's no builtin function to get the type of browser. Why do you need it?

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Re: Browser Detection?

Postby jt » Thu Sep 24, 2009 10:52 pm

We are using Scott’s method to customize tabs in the webclient using a style sheet to override the default web styles. Due to some differences/bugs in older browsers (IE7), we need to make further accommodation to adjust for broken or unsupported styles.
J T Young
TMASystems
-------------------------------------------------------------------
Servoy Developer
Version 5.2.4, Build 1006
Java version 1.6.0_21 (Windows Vista)
SQL Server 2005 SP3/Oracle 10g R2
jt
 
Posts: 30
Joined: Sat May 05, 2007 10:17 pm
Location: Tulsa, Oklahoma

Re: Browser Detection?

Postby Harjo » Fri Sep 25, 2009 8:53 am

we are happy with this: http://code.google.com/intl/nl/chrome/chromeframe/

with this, you can use the chrome render engine inside Internet Explorer (even IE 6!!)

It would be wonderfull, if we could detect if chromeframe is installed, if not show show such image:
Afbeelding 50.png
You do not have the required permissions to view the files attached to this post.
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: Browser Detection?

Postby pbakker » Fri Sep 25, 2009 9:06 am

Hi JT,

If it's stylesheets you need to customize based on the browser it's running on, why not use conditional comments inside the stylesheet?

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Re: Browser Detection?

Postby pbakker » Fri Sep 25, 2009 10:29 am

@harjo: what's the point of Google Chrome Frame inside IE?

Instead of upgrading their browser, users would have to install the "Google Chrome Frame" plugin into their Internet Explorer browser.

Only advantage would be for companies that have legacy apps build on top of IE5.5/6/7 that cannot or have not been ported to IE8/been made to support all browsers, thus they cannot upgrade to IE8 and who's IT department does not allow users/does not want to install another modern browser besides the old IE instance.

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Re: Browser Detection?

Postby Harjo » Fri Sep 25, 2009 10:54 am

@ Paul, what's the point that Google Chrome Frame has build this for IE than? ;-)

the point is, that still 30-40% use IE6 (we can see this in our statistics of our webservers)
we think users, rather want to install a IE plugin in IE6, than upgrading it. (many users downgraded back to IE6 because of problems with IE7 in the beginning)

And for instance Servoy webclient runs much smoother (quicker) in chrome.
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: Browser Detection?

Postby pbakker » Fri Sep 25, 2009 11:15 am

what's the point that Google Chrome Frame has build this for IE than?


To somehow offer companies that cannot move away from ie6 for technical reasons a way to still offer their users a way to run Google Wave when it's going to be released later this year.

Users should just upgrade their browsers of get another browser of they are allowed to do so :-)

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Re: Browser Detection?

Postby Harjo » Fri Sep 25, 2009 11:40 am

I know in theory this is the best way. In practise, this is not the case ;-)
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Next

Return to Servoy Web Client

Who is online

Users browsing this forum: No registered users and 1 guest