Closed kaspar-allenbach closed 6 years ago
Hi @kaspar-allenbach, sorry for ignoring your issue. craft.request.isMobileBrowser
doesn't leverage a library, just some regex to parse the client's user-agent to test for the most common mobile browsers. If all you need is to know if a request is coming from a mobile (phone or phone/tablet), craft.request.isMobileBrowser
would do the job for you in most cases.
Detect, which uses the excellent Mobile_Detect library, is basically much more powerful in terms of available tests and functionality, it's probably more reliable for more browsers/user agents, etc. That's basically it :)
I just learned about
{% if craft.request.isMobileBrowser() %}
. Do you know the difference between this and your plugin? Is it just using another library?