Actions

Widget

DeviceType: Difference between revisions

From OSE

No edit summary
No edit summary
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>
<div id="device_sizing">
<div id="device_sizing">
     <!-- Placeholder for the widget content -->
     <!-- Placeholder for the widget content -->
</div>
</div>
 
</includeonly>
<script type="text/javascript">
function getDeviceType() {
        const userAgent = navigator.userAgent.toLowerCase();
  if (userAgent.includes('mobile') || userAgent.includes('android') || userAgent.includes('iphone') || userAgent.includes('ipad')) {
    return 'mobile';
  } else if (userAgent.includes('tablet')) {
    return 'tablet';
  } else {
    return 'desktop';
  }}
</script>

Latest revision as of 00:37, 31 May 2025