Amazon.com music store doesn't redirect to mobile version

RESOLVED WORKSFORME

Status

defect
RESOLVED WORKSFORME
5 years ago
6 months ago

People

(Reporter: sviter33, Unassigned, Mentored)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [country-us] [clientsniff] [contactready] [tablet] [webkitcss] [serversniff], )

User Agent: Mozilla/5.0 (Android; Tablet; rv:34.0) Gecko/34.0 Firefox/34.0 (Nightly/Aurora)
Build ID: 20140807084340

Steps to reproduce:

Go to http://amazon.com/MP3-Music-Download/b/ref=topnav_storetab_dmusic?ie=UTF8&node=163856011 on Samsung Galaxy Tab GT-P3100 with Android 4.2.2


Actual results:

You will be redirected to http://www.amazon.com/MP3-Music-Download/b/ref=topnav_storetab_dmusic?ie=UTF8&node=163856011


Expected results:

In android browser you will be redirected to https://www.amazon.com/gp/dmusic/device/mp3/store?ie=UTF8&node=163856011&redirected=1#gp/dmusic/device/mp3/store
OS: All → Android
Hardware: All → ARM
# On Tablet
    Firefox Android:    "Mozilla/5.0 (Android; Tablet; rv:30.0) Gecko/30.0 Firefox/30.0"
AND Galaxy Tab2 Chrome: "Mozilla/5.0 (Linux; Android 4.2.2; GT-P3113 Build/JDQ39) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.141 Safari/537.36"


We get

→ http --print hH GET 'http://amazon.com/MP3-Music-Download/b/ref=topnav_storetab_dmusic?ie=UTF8&node=163856011' 'User-Agent: Mozilla/5.0 (Android; Tablet; rv:30.0) Gecko/30.0 Firefox/30.0' | egrep -i '^HTTP/|^location:'
HTTP/1.1 301 Moved Permanently
Location: http://www.amazon.com/MP3-Music-Download/b/ref=topnav_storetab_dmusic?ie=UTF8&node=163856011

→ http --print hH GET 'http://www.amazon.com/MP3-Music-Download/b/ref=topnav_storetab_dmusic?ie=UTF8&node=163856011' 'User-Agent: Mozilla/5.0 (Android; Tablet; rv:30.0) Gecko/30.0 Firefox/30.0' | egrep -i '^HTTP/|^location:'
HTTP/1.1 200 OK


The detection logic starts in the page with a client side script.
https://www.amazon.com/gp/dmusic/device/mp3/store?ie=UTF8&node=163856011&redirected=1#home

  <script type="text/javascript">
    (function() {
      try {
        var alreadyRedirected = /[?|&]redirected=1/.exec(location.search);
        var redirectUrl = "/gp/dmusic/redirect/html5store";
        redirectUrl += window.location.search;

        if (window.navigator.userAgent.match(/iphone|ipod/gi) && !alreadyRedirected) {
          window.location = redirectUrl;
        }

        var androidMatch = window.navigator.userAgent.match(/Android\s+(\d\.\d)/i);
        var androidVersion = (androidMatch && androidMatch[1]) ? parseFloat(androidMatch[1]) : 0.0;
        if (androidVersion >= 2.3 && !alreadyRedirected) {
          window.location = redirectUrl;
        }
      }
      catch(e) {
        // Swallow the exception
      }
    })();
  </script>

This redirects to http://www.amazon.com/gp/dmusic/redirect/html5store 
which has an additional layer of user agent detection logic this time server side
to https://www.amazon.com/gp/dmusic/device/mp3/store
And it redirects to the initial desktop content if Firefox Android Tablet.

So Amazon needs to fix a couple of user agent detection scripts on both client side and server side on different servers.

Then we enter an additional set of issues. This CSS is designed with -webkit- CSS properties and will fail on Gecko.
https://images-na.ssl-images-amazon.com/images/G/01/browser-scripts/dmusic_device_store_android_browser_alpha/dmusic_device_store_android_browser_alpha-min-2259811372._V1_.css


It's difficult to know if they have a stylesheet for non WebKit rendering engines.
Mentor: kdubost
Status: UNCONFIRMED → NEW
Ever confirmed: true
Whiteboard: [country-us] [clientsniff] [contactready] [tablet] [webkitcss] [serversniff]
I tested this in a build with an Android version number, saw no problems at all.

Automated analysis shows that some elements still have webkit-transition styling in WebKit and not in Gecko - but since I don't find actual problems we'll assume it ain't mean a thing.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WORKSFORME
Product: Tech Evangelism → Web Compatibility
You need to log in before you can comment on or make changes to this bug.