Page 1 of 1

Detemining Client Browser Being Used

Posted: Thu Aug 18, 2011 2:38 pm
by marcv
Hi Folks,

We have 3.0.8 of PUI installed and I am completing a fairly complex proof-of-concept application for management signoff on product acquisition. My application has mutiple chart widgets in use and they of course will not render on an iPad/Mac because of Apple's lack of support for Flash.

I would like to put in some RPG logic to display other screen objects in place of the charts if the client web browser is being used on an iPad or Mac (i.e. if Safari is being used). Is there any kind of environment variable within PUI that I can make known to my RPG app via a variable that will tell my app that Safari is being used so I can display the Safari-specific screen objects in place of the charts?

Thanks,

Marc Vadeboncoeur
Astro-Med, Inc.

Re: Detemining Client Browser Being Used

Posted: Fri Aug 19, 2011 10:39 am
by Brian
So, my first question is will this be running as a pure PUI application or will it be called from a Genie session?

If not called from a Genie session, there is an environment variable on the job, HTTP_USER_AGENT. There is a lot of info in here, so this article (http://www.quirksmode.org/js/detect.html) can help you interpret it.

If the program will be called from within Genie, it is possible but much more involved as we do not have the ability to create a simple environment variable. If you need instructions for running under Genie, let me know.


Also, I don't think you want to monitor for Safari. I don't have a Mac in front of me, but I'm pretty sure it supports flash on Mac and PC. It's the iPhone/iPad that has the issue. So you may want to monitor for the OS instead. It is in there as well.