1

In most cases websites will look at the user agent header and then redirect or serve mobile content if accessed from mobile device.

However, there are some sites that will serve mobile content even if you change agent in your browser (request desktop site in Android, for example).

An example of such site would be www.t-mobile.com. There are also some others.

How do those sites detect mobile regardless of user-agent header?

I read that network packet TTLs may be different for mobile and actual desktop. Is it the case? But that would require pretty low level proxy to detect.

Kevin Panko
  • 7,466

1 Answers1

1

As stated in my comment, the newer more future proof sites don't detect mobile devices using user agent sniffing or any other means... They include css media queries to make the page render properly on mobile and desktop.

Some example css might look like this:

/* mobile first */
.page,
.sidebar {
    width: 100%;
    padding: 10px;
}

img {
    max-width: 100%
}

@media screen and (min-width:960px){
    .page {
        width: 960px;
        padding: 3px;
    }

    .sidebar {
        float: left;
        width: 30%;
    }
}
philwills
  • 151