fenix icon indicating copy to clipboard operation
fenix copied to clipboard

Request desktop site does not work for all sites

Open bsurd opened this issue 7 years ago • 12 comments

Steps to reproduce

  1. Go to wikipedia.org.
  2. Tap on the 3 dot menu and toggle the "Request desktop site" option.

Expected behavior

  • The desktop site is requested and displayed after a page reload.

Actual behavior

  • Nothing happens, the site remains in mobile version.

Device information & notes

  • Android device:

    • Nexus 5 (Android 6.0.1)
    • Nokia 6 (Android 7.1.1)
    • Samsung Galaxy Note 8 (Android 8)
    • Google Pixel (Android 9)
  • Fenix version: 1.0 (12.08.2019 - taskcluster id: CX8is5arTZmzWLJ9BGRGAA)

  • Certain pages are not affected by this (eg. google.com), while on others like wikipedia, if you request the desktop site and then navigate to a different page it will give you the desktop version of that page.

  • The same issue has been logged for R-B as well Link

┆Issue is synchronized with this Jira Task

bsurd avatar Feb 12 '19 08:02 bsurd

Thanks @bsurd!

It looks like this webpage is a responsive page, so we are requesting the desktop site, but without also messing with the window size, we are then getting the mobile sized responsive site.

ekager avatar Feb 13 '19 01:02 ekager

This bug then is that request desktop site should use a desktop view port size and screen density to emulate a desktop display.

kbrosnan avatar Apr 29 '19 23:04 kbrosnan

We're actually already setting a wideViewPort in a-c.

@cpeterso is there a possibility GV isn't setting the view port wide enough?

sblatz avatar May 07 '19 18:05 sblatz

In addition to setting the UA, the desktop viewport must be enabled: https://searchfox.org/mozilla-central/rev/99a2a5a955960b0e58ceade1db1f7652d9db4ba1/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSessionSettings.java#189

bluemarvin avatar May 07 '19 23:05 bluemarvin

In addition to setting the UA, the desktop viewport must be enabled: https://searchfox.org/mozilla-central/rev/99a2a5a955960b0e58ceade1db1f7652d9db4ba1/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSessionSettings.java#189

Ah, this is new from when desktop mode was implemented. It's definitely an a-c fix needed.

jonalmeida avatar May 10 '19 19:05 jonalmeida

@bluemarvin, @jonalmeida Setting the viewport doesn't seem to have any effect on the affected site (wikipedia.org). Diff example

What's odd is that, even without this change and just using the user agent "desktop" mode, I'm getting a "wider" view port on many sites:

image

sblatz avatar May 10 '19 21:05 sblatz

What's odd is that, even without this change and just using the user agent "desktop" mode, I'm getting a "wider" view port on many sites

"Desktop mode" isn't a standard that exists or convention every site follows unfortunately, so some sites change themselves by UA or viewport. Since the site in question right now is wikipedia, we should focus on that as our initial test.

I see Focus GV showing the desktop version of the site, so I'm curious what's happening there that we aren't doing (since the a-c was originally based off that).

jonalmeida avatar May 10 '19 21:05 jonalmeida

@jonalmeida Even weirder: all Focus is doing is setting the user agent (https://github.com/mozilla-mobile/focus-android/blob/master/app/src/main/java/org/mozilla/focus/web/GeckoWebViewProvider.kt#L258)

sblatz avatar May 10 '19 21:05 sblatz

@jonalmeida Even weirder: all Focus is doing is setting the user agent (https://github.com/mozilla-mobile/focus-android/blob/master/app/src/main/java/org/mozilla/focus/web/GeckoWebViewProvider.kt#L258)

It seems like Focus is using GV 65 which is before the API had been added view ports, so there might have been a regression in GV. Worth filing a bug there next!

jonalmeida avatar May 10 '19 23:05 jonalmeida

focus-android's master is out of date. The latest code is in the releases/v8.0 branch:

https://github.com/mozilla-mobile/focus-android/commits/releases/v8.0

cpeterso avatar May 11 '19 00:05 cpeterso

~~@cpeterso could catch, though I still don't see Focus setting the viewport at all: https://github.com/mozilla-mobile/focus-android/blob/releases/v8.0/app/src/main/java/org/mozilla/focus/web/GeckoWebViewProvider.kt#L243.~~

~~Of note, Focus is using this GV version. Is it possible there actually is a regression?~~

🤦‍♂ I was only setting the viewport change in a specific version of GV in a-c (not in beta/nightly versions). I have it working now.

sblatz avatar May 13 '19 17:05 sblatz

Verified as fixed on the latest build 1.0.1920 (#11360657), with Google Pixel (Android 9), Nexus 5 (Android 6.0.1), Samsung Galaxy S8 (Android 9), and Sony Xperia Z5 Premium (Android 7.1.1).

lobontiumira avatar May 16 '19 12:05 lobontiumira