Actions

Widget

Widget:DeviceType

From OSE

Revision as of 19:57, 30 May 2025 by Ose (talk | contribs)

<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';
 }

}

if (getDeviceType() === "desktop") {

       document.write("

");

} else {

       document.write("

");

} </script>