Re: [web2py] Re: Mobile and Tablets detection

2020-10-03 Thread Andrew Rogers
Hi

I am having trouble with  detecting a mobile user when emulating an iPhone 
(or any of the mobile devices) in the desktop version of Chrome.  Edge 
seems to work fine.

*request.user_agent() * gives me:
, 'os': 
, 'bot': False, 'browser': 
, 'is_mobile': 
*False*, 'is_tablet': False}>

*request.env.http_user_agent *gives me:
'Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) 
AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 
Safari/602.1'

Is there any trick to getting that emulation working correctly in Chrome?

Andrew

FYI, this is what I get when using the emulation in Edge

request.user_agent()
, 'os': 
, 'bot': False, 'dist': , 'browser': , 'is_mobile': True, 'is_tablet': False}>

request.env.http_user_agent
'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) 
AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 
Safari/604.1 Edg/85.0.4183.121'
On Sunday, 21 July 2013 at 21:22:52 UTC+10 LightDot wrote:

> A quick look at WURFL - looks fine, except for the license which might be 
> problematic for some projects - AGPL v3. They offer commercial licenses 
> too, which might solve the problem for some.
>
> Regards,
> Ales
>
> On Saturday, July 20, 2013 6:14:17 PM UTC+2, Christian Foster Howes wrote:
>>
>> is the WURFL library of devices more or less complete then the mobile 
>> browser list?  http://wurfl.sourceforge.net/  I used the WURFL 5-6 years 
>> ago and found it to be the most complete open-source list at the time.
>>
>> On Wednesday, July 17, 2013 11:57:28 PM UTC-7, AngeloC wrote:
>>>
>>> Hi Marcio,
>>>
>>> I'm planning to grow the supported mobile devices list in web2py, but 
>>> the support right now is fairly extensive. 
>>> I got the user agent strings here 
>>> http://www.useragentstring.com/pages/Mobile%20Browserlist/ and added at 
>>> least one of the devices for each family to the unit test of 
>>> gluon/contrib/user_agent_parser.py .
>>>
>>> That class right now could discriminate between phone and tablets, so I 
>>> think you can't find somany differences with http://mobiledetect.net/ .
>>>
>>> Sincerly,
>>> Angelo
>>>
>>> -- 
>>> Profile: http://it.linkedin.com/in/compagnucciangelo 
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/ce5b3f1b-2932-4a30-ae71-634800c1cb35n%40googlegroups.com.


Re: [web2py] Re: Mobile and Tablets detection

2013-07-21 Thread LightDot
A quick look at WURFL - looks fine, except for the license which might be 
problematic for some projects - AGPL v3. They offer commercial licenses 
too, which might solve the problem for some.

Regards,
Ales

On Saturday, July 20, 2013 6:14:17 PM UTC+2, Christian Foster Howes wrote:

 is the WURFL library of devices more or less complete then the mobile 
 browser list?  http://wurfl.sourceforge.net/  I used the WURFL 5-6 years 
 ago and found it to be the most complete open-source list at the time.

 On Wednesday, July 17, 2013 11:57:28 PM UTC-7, AngeloC wrote:

 Hi Marcio,

 I'm planning to grow the supported mobile devices list in web2py, but the 
 support right now is fairly extensive. 
 I got the user agent strings here 
 http://www.useragentstring.com/pages/Mobile%20Browserlist/ and added at 
 least one of the devices for each family to the unit test of 
 gluon/contrib/user_agent_parser.py .

 That class right now could discriminate between phone and tablets, so I 
 think you can't find somany differences with http://mobiledetect.net/ .

 Sincerly,
 Angelo

 -- 
 Profile: http://it.linkedin.com/in/compagnucciangelo 



-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: Mobile and Tablets detection

2013-07-20 Thread Christian Foster Howes
is the WURFL library of devices more or less complete then the mobile 
browser list?  http://wurfl.sourceforge.net/  I used the WURFL 5-6 years 
ago and found it to be the most complete open-source list at the time.

On Wednesday, July 17, 2013 11:57:28 PM UTC-7, AngeloC wrote:

 Hi Marcio,

 I'm planning to grow the supported mobile devices list in web2py, but the 
 support right now is fairly extensive. 
 I got the user agent strings here 
 http://www.useragentstring.com/pages/Mobile%20Browserlist/ and added at 
 least one of the devices for each family to the unit test of 
 gluon/contrib/user_agent_parser.py .

 That class right now could discriminate between phone and tablets, so I 
 think you can't find somany differences with http://mobiledetect.net/ .

 Sincerly,
 Angelo

 -- 
 Profile: http://it.linkedin.com/in/compagnucciangelo 


-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Mobile and Tablets detection

2013-07-20 Thread Marcio Andrey Oliveira
I have no idea how complete WURFL is but it it seems that 
request.user_agent()  will do the job.

Regards.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Mobile and Tablets detection

2013-07-18 Thread Niphlod
ok, you're fond of that php library. But did you take a closer look to what 
you have right in web2py using request.user_agent() ?
web2py uses gluon/contrib/user_agent_parser.py to fill up those fields 
and it does the exact same thing!

Il giorno giovedì 18 luglio 2013 01:05:11 UTC+2, Marcio Andrey Oliveira ha 
scritto:

 Hi.

 Thank you for replying.

 I really don't know all user agents and I prefer to rely on a library that 
 automatically detects whether the users is browsing from a regular 
 computer, a mobile or a tablet. The greatest benefit (IMHO) from 
 mobiledetect is that it's regularly updated to incorporate new devices.

 If you take a look at mobile detect source code you will see that are 
 around 1,300 devices up to now.

 I thought I could try to convert its code from PHP to python but as I'm 
 not that good on python I wondered if someone in python community have made 
 a similar library / module.

 Regards.

 On Wednesday, July 17, 2013 3:12:47 PM UTC-3, Marcio Andrey Oliveira wrote:

 Hi.

 I'm wondering whether exists a python project that detect mobiles and 
 tables that be as good and as up to date as http://mobiledetect.net/

 Thanks.



-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: Mobile and Tablets detection

2013-07-18 Thread Angelo Compagnucci
Hi Marcio,

I'm planning to grow the supported mobile devices list in web2py, but the
support right now is fairly extensive.
I got the user agent strings here
http://www.useragentstring.com/pages/Mobile%20Browserlist/ and added at
least one of the devices for each family to the unit test of
gluon/contrib/user_agent_parser.py .

That class right now could discriminate between phone and tablets, so I
think you can't find somany differences with http://mobiledetect.net/ .

Sincerly,
Angelo

-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: Mobile and Tablets detection

2013-07-18 Thread Marcio Andrey Oliveira
Niphlod, I'm fairly new to web2py (I'm reading the official book but I'm
still on page #160 of 614 pages) and I'm trying to collect the most
possible information that I think relevant for what I'm planning to do.

Even if I had read entirely book I believe that not all information about
web2py will be there. That's why I'm asking.

All information I gather will help me decide which framework better fits my
needs.

I understood from your last email that I could call
request.user_agent()and then I should figure out by myself whether
it's a mobile user agent or
not what I don't think feasible. The mobile detect library has methods like
*is_mobile()*, ? and *is_android()* that make life easier.

Thank you for taking your time to answer my post. I really appreciate that.



Angelo, I'm glad to hear that.

Could you please show me a snippet on how to test if a browser is mobile?

Thank you a lot.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: Mobile and Tablets detection

2013-07-18 Thread vince
fyi request.user_agent().is_mobile will return false for ipod touch now.

On Thursday, July 18, 2013 9:43:10 PM UTC+8, Marcio Andrey Oliveira wrote:

 Niphlod, I'm fairly new to web2py (I'm reading the official book but I'm 
 still on page #160 of 614 pages) and I'm trying to collect the most 
 possible information that I think relevant for what I'm planning to do.

 Even if I had read entirely book I believe that not all information about 
 web2py will be there. That's why I'm asking.

 All information I gather will help me decide which framework better fits 
 my needs.

 I understood from your last email that I could call request.user_agent()and 
 then I should figure out by myself whether it's a mobile user agent or 
 not what I don't think feasible. The mobile detect library has methods like 
 *is_mobile()*, ? and *is_android()* that make life easier.

 Thank you for taking your time to answer my post. I really appreciate that.



 Angelo, I'm glad to hear that.

 Could you please show me a snippet on how to test if a browser is mobile?

 Thank you a lot.


-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Mobile and Tablets detection

2013-07-18 Thread Marcio Andrey Oliveira
vince, thank you for answering me.

Regards.

On Wednesday, July 17, 2013 3:12:47 PM UTC-3, Marcio Andrey Oliveira wrote:

 Hi.

 I'm wondering whether exists a python project that detect mobiles and 
 tables that be as good and as up to date as http://mobiledetect.net/

 Thanks.


-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: Mobile and Tablets detection

2013-07-18 Thread Niphlod
I get the tell me more argument, but if you fire up web2py and just try 
it, you'll find those things on your own if you just use 
request.user_agent().
You can even find out that the scaffolding application make use of this by 
default inspecting request.user_agent().is_mobile flag to render a 
mobile-compatible menu out based on user_agent parsing.
Yep, it may be not updated in a while, but that can be easily fixed as 
@angelo said already in a previous post.

On Thursday, July 18, 2013 3:43:10 PM UTC+2, Marcio Andrey Oliveira wrote:

 Niphlod, I'm fairly new to web2py (I'm reading the official book but I'm 
 still on page #160 of 614 pages) and I'm trying to collect the most 
 possible information that I think relevant for what I'm planning to do.

 Even if I had read entirely book I believe that not all information about 
 web2py will be there. That's why I'm asking.

 All information I gather will help me decide which framework better fits 
 my needs.

 I understood from your last email that I could call request.user_agent()and 
 then I should figure out by myself whether it's a mobile user agent or 
 not what I don't think feasible. The mobile detect library has methods like 
 *is_mobile()*, ? and *is_android()* that make life easier.

 Thank you for taking your time to answer my post. I really appreciate that.



 Angelo, I'm glad to hear that.

 Could you please show me a snippet on how to test if a browser is mobile?

 Thank you a lot.


-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Mobile and Tablets detection

2013-07-17 Thread Niphlod
because response.user_agent doesn't work for you ?

On Wednesday, July 17, 2013 8:12:47 PM UTC+2, Marcio Andrey Oliveira wrote:

 Hi.

 I'm wondering whether exists a python project that detect mobiles and 
 tables that be as good and as up to date as http://mobiledetect.net/

 Thanks.


-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Mobile and Tablets detection

2013-07-17 Thread Niphlod
whoops. request.user_agent()

On Wednesday, July 17, 2013 11:50:10 PM UTC+2, Niphlod wrote:

 because response.user_agent doesn't work for you ?

 On Wednesday, July 17, 2013 8:12:47 PM UTC+2, Marcio Andrey Oliveira wrote:

 Hi.

 I'm wondering whether exists a python project that detect mobiles and 
 tables that be as good and as up to date as http://mobiledetect.net/

 Thanks.



-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Mobile and Tablets detection

2013-07-17 Thread Marcio Andrey Oliveira
Hi.

Thank you for replying.

I really don't know all user agents and I prefer to rely on a library that 
automatically detects whether the users is browsing from a regular 
computer, a mobile or a tablet. The greatest benefit (IMHO) from 
mobiledetect is that it's regularly updated to incorporate new devices.

If you take a look at mobile detect source code you will see that are 
around 1,300 devices up to now.

I tough I could try to convert its code from PHP to python but as I'm not 
that good on python I wondered if someone in python community have made a 
similar library / module.

Regards.

On Wednesday, July 17, 2013 3:12:47 PM UTC-3, Marcio Andrey Oliveira wrote:

 Hi.

 I'm wondering whether exists a python project that detect mobiles and 
 tables that be as good and as up to date as http://mobiledetect.net/

 Thanks.


-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.