mdipierro <mdipierro@...> writes:

> 
> This may be useful
> 
> http://web2py.com/examples/static/mobile_device_detect.py
> 
> On Jun 23, 8:38 am, Doug Warren <doug.war...@...> wrote:
> > Does anyone have some hints for showing mobile browsers a different
> > set of views than desktop browsers?  IE: Detection, redirection,
> > etc...  Since the view is determined by the extension of the page how
> > do people handle it?
> 
> 


I have add this line at the beginning of the fucntion, because msie internet 
explorer browser was recognized as a mobile device.

def ifmobile(request):
   # added start
   if string.find(request.env.http_user_agent,'MSIE')>0: return False
   # added end

   if request.env.http_x_wap_profile or request.env.http_profile: return True
   ...

Is there a better solution to this problem?

Here is request.env.http_user_agent from MSIE Internet Explorer:

http_user_agent : Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; 
Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; 
Media Center PC 6.0; InfoPath.3; .NET4.0C; FDM; Tablet PC 2.0) 

Reply via email to