mozilla / addons

☂ Umbrella repository for Mozilla Addons ✨
Other
127 stars 41 forks source link

"Back" button redirects from "desktop" to "mobile" page #10360

Closed SVSanta closed 7 years ago

SVSanta commented 7 years ago

Steps to reproduce:

  1. Navigate to a page on your Android device i.e. addons.allizom.org
  2. Change the language
  3. Tap on the "View desktop site" button.
  4. Tap on the "Back" button.

Expected results: The user is redirected to the previous page.

Actual results: The page layout is changed from "desktop" to "mobile".

Notes/Issues: Verified on FF53(Android 6.0.1). Issue is reproducing all around AMO servers. Video for this issue: videotogif_2017 05 03_16 28 55

tofumatt commented 7 years ago

We show/hide the mobile site with a cookie and the browser's back button changes just the URL. So this is sort of by design and also not something we could (easily) fix.

SVSanta commented 7 years ago

@tofumatt I see this as an important issue, because the "back" button is frequently used and this creates issues when switching the language or adding other scenarios to this issue. For example:

  1. If the language is switched prior to the "View desktop site" change when the user taps on the "back" button the language is switched to the previous one.
  2. Changing the language again after using the "back" button in the "mobile site view" mode will redirect the user to the "View desktop site" view mode. videotogif_2017 05 04_11 27 31
tofumatt commented 7 years ago

We change the URL when we change language so it is possible (indeed, normal) to allow the user to go back and change their locale.

Because we set visibility of the mobile site with a cookie there is no easy way to change the site served on the back button.

Fortunately, this issue will go away in the future when all requests, desktop and mobile, are served via add-ons frontend. But there is no way to fix this for now and is standard browser behaviour (and common on many sites)