0

I did some research, and am aware of there are 2 ways to detect a mobile website, either by check user-agent, or by screen resolution. Though it seems that zara.com does not use 1 of those 2. For instance, open zara.com with chrome debugger mobile mode would not return mobile site, or "Request desktop site" on iOS would not return desktop site.

So I am really curious, how does Zara do it?

Dharman
  • 21,838
  • 18
  • 57
  • 107
ChiNhan
  • 69
  • 3

1 Answers1

-1

This is the code I used in my projects.

function isMobile() {
 try {
    if(/Android|webOS|iPhone|iPad|iPod|pocket|psp|kindle|avantgo|blazer|midori|Tablet|Palm|maemo|plucker|phone|BlackBerry|symbian|IEMobile|mobile|ZuneWP7|Windows Phone|Opera Mini/i.test(navigator.userAgent)) {
     return true;
    };
    return false;
 } catch(e){ console.log("Error in isMobile"); return false; }
}
Kundan
  • 741
  • 8
  • 22