Detecting mobile browser
Posted: Sun Jan 05, 2025 6:44 pm
Web looked bad on a mobile device, so I detecting mobile browser and reducing the image preview.
Is extension that detects the mobile and change the template or change .css?
Code: Select all
<script>
if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){
document.currentScript.outerHTML = `[img=images/mapka_apartmany.jpeg scale=5% float=right]`;
}else{
document.currentScript.outerHTML = `[img=images/mapka_apartmany.jpeg scale=18% float=right]`;
}
</script>