Browser Detection

Browser Detection 2.3.1

No permission to download

mdandu

Administrator
Staff member
Nov 10, 2024
695
9
18
mdandu submitted a new resource:

Browser Detection - Browser Detection

A light-weight shim around Mobile_detect for XenForo 2

Usage (in templates)
The add-on injects the global variable $xf.mobileDetect, check that the variable is set before calling any methods to prevent errors during upgrades or if the add-on is disabled.

Code:
<xf:if is="$xf.mobileDetect && $xf.mobileDetect.isMobile()">
    Is Mobile
<xf:else />
    Not Mobile
</xf:if>

CSS:
<xf:if is="$xf.mobileDetect && $xf.mobileDetect.is('Firefox')">
    Is Firefox
<xf:else />
    Not...

Read more about this resource...