New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 622204 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug-Regression



Sign in to add a comment

"Force Desktop Site" conflates viewport meta with the overriding user agent flag

Reported by davve@opera.com, Jun 22 2016

Issue description

The "Force Desktop Site" feature currently sends an alternative UA string together with disabling viewport meta tags. The latter part is a recent addition, as I understand it. 

But internally, chromium still uses entry->GetIsOverridingUserAgent() as indication whether the feature is enabled for a navigation entry or not. (See NavigationControllerAndroid::GetUseDesktopUserAgent())

Admittedly, Opera for Android had some confused code for specifying our UA string (we want to append OPR and our version number) and this caused us having the overriding user agent flag set in too many cases. Which in turn disabled all viewport meta tags(!) when https://codereview.chromium.org/1785953002 landed.

We have now straightened out the code on our side but the connection between entry->GetIsOverridingUserAgent() and viewport meta tags was a bit surprising. Perhaps it can be made clearer in the code what GetIsOverridingUserAgent() actually means, and what implications it should have.
 

Comment 1 by aelias@chromium.org, Jun 22 2016

Agreed, the scope expanded past the original name and it's a bit confusing.  It sounds like essentially a naming problem.  If you want to upload a patch to rename most uses IsOverridingUserAgent to something broader like IsRequestingDesktopSite, maybe keeping the name only for the parts that exclusively change the UA, I'd lgtm that.

Comment 2 Deleted

I have just hit this problem on Chrome Mobile where I can no longer change the viewport meta tag dynamically in Request Desktop Site mode. This new behavior of disabling viewport meta tag changes comes as unexpected. I have a specific script dealing with this and set a custom 768 to 1024 width (depending on orientation) for this mode, which I detect in all mobile browsers.

I don't mind if you ignore the initial markup meta viewport. It makes senses for this mode. But I don't want to be restricted to that silly 980px width which doesn't exist anywhere else but on mobile. Could you restore the ability to dynamically set a custom width with javascript please.

Should I file a separate issue for that?
Cc: bruno.ra...@gmail.com
It would be a separate issue.

Ignoring viewport meta tag is by design (see discussion at  http://crbug.com/586286 ) and we're unlikely to go back on that specific point.  I think of "Request Desktop Site" as a desktop browser spoofing mode, sort of like the converse of devtools mobile device emulation.  Desktop browsers ignore viewport tag, so this mode should too -- this results in more desktop-accurate rendering.

As for the 980, think of it as analogous to the window width set by the resizer in a desktop browser.  Desktop sites cannot directly affect that width in JS, so you can't either in this mode.  But I think you can likely get whatever visual effect you want by applying a CSS scale to your entire content to make it fit in 980 pixels.  Coordinates are relative in modern browsers anyway, the concept of CSS/HTML "pixel" at this point has no relation to anything real except for historical pixel size on a monitor from the year 2000.
Components: UI>Browser>Mobile
Cc: tedc...@chromium.org
Labels: android-fe-triaged
Status: Available (was: Untriaged)
cc +tedchoc@ since GetUseDesktopUserAgent() was written by dfalcantara

Sign in to add a comment