Mobile emulation doesn't work when sites "remember" desktop mode
Reported by
teo8...@gmail.com,
Jul 6
|
||||
Issue descriptionUserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36 Steps to reproduce the problem: On Desktop Chrome: 1. open the Developer Tools 2. enable Mobile emulation 3. visit https://www.youporn.com/ Compare to how the site looks like on a real mobile device (i.e. Chrome on Android) What is the expected behavior? When emulating the mobile device, the site should look like when browsing from a mobile What went wrong? It's the Desktop version on a smaller screen. It doesn't matter if this is particular website is doing something wrong. If this site correctly detects a real mobile device as a mobile device, and fail to detect the emulated mobile device as a mobile devive, then something is wrong in the mobile emulation, because by definition it should be undistinguishable to the site (both to the server and to the client-side content). Did this work before? N/A Chrome version: 67.0.3396.99 Channel: stable OS Version: Flash Version:
,
Jul 10
I see what's happening. After a while, I tried again and it was working as expected. Now, on desktop, I see the mobile version of the site. And I have cleared all the cookies from the site and reloaded. I'm struggling to imagine how this could be entirely the website's fault. - If the website is "remembering" me when I switch mobile emulation on and off, I can think of two ways they can identify me as being the same "session" (of some kind): a. through cookies. But I delete them and reload after switching between mobile and desktop mode b. via some combination of user agent string and IP and something else. But since the user agent changes, that should be enough for the website to not recognize you as the same user from before. And, given that by turning on mobile emulation you are emulating a **different device**, it could be argued that Chrome should keep a completely isolated environment (certainly cookies, perhaps cache - NOT browsing history) so that nothing from a device should leak to the other. Being logged out of sites you logged in on desktop when switching to mobile might be a minor annoyance, but it's far more predictable and consistent than the current behavior, where you DO actually get logged out sometimes when switching between mobile and desktop, but not always, and sometimes you get behavior like this one described in this issue.
,
Jul 10
Just to clarify: > Now, on desktop, I see the mobile version of the site. I mean, after having emulated mobile, cleared all cookies, switched to desktop (i.e. no emulation) and reloaded, now on the desktop with no emulation I am getting the mobile site, which is obviously not expected.
,
Jul 10
And when I say I "clear/delete the cookies from this website" I mean I click on the lock icon on the left of the address bar, I go to "Cookies" and I do "Remove" for all the domains listed under "Cookies in use". By the way, I had (for reasons unrelated to this bug) inspected some of the site's javascript code and it seemed to use Storage. If that's the case, I would expect either: - to see a "Storage" section in "View Site Information", besides "Cookies", "Certificates" and "Site settings", OR - to find something about Storage within "Site Settings", OR - when I delete the cookies, for all the data stored under Storage to be deleted too. (actually, I think it must be one of the other two, I don't think this third one is acceptable, but definitely less unacceptable than having no control at all on the storage data and it being stored forever) Now that I am loading this on desktop with no mobile emulation and after deleting the cookies several times, I'm seeing this on the console: ServiceWorker scope: https://www.youporn.com/ Expected version: aa2af1a6ac0c469e3ff3a9be3ddc1e9f5ea952f0 This is related to code registering a ServiceWorker. I wonder if some data related to the service worker has "leaked" from the emulated mobile device to the host desktop (real) device. Any such sort of "leakage" would be a bug.
,
Jul 30
As per comment #4 It is not possible to test the given URL from TE-End. Hence adding 'TE-NeedsTriageHelp' label and requesting the Dev tool team to look into the issue and help in further triaging. Thanks...!
,
Jul 30
> As per comment #4 It is not possible to test the given URL That's not true, certainly not "as per comment 4". Have you read comment 2? Chances are, if you retry enough times, you will be able to see either one issue or the other: mobile version in desktop mode or viceversa. Note this: > And, given that by turning on mobile emulation you are emulating a **different device**, it could be argued that Chrome should keep a completely isolated environment (certainly cookies, perhaps cache - NOT browsing history) You are certainly not doing that, and you should.
,
Aug 18
Thank you for the report. I see how a website's use of storage to remember the client's mobile/desktop could trip us up, when we enter device mode. I imagine that many other sites might be doing this. To address this issue completely, we would need to cover all ways that a site could store data on the client side. I do not believe that automatically clearing site data upon enabling device mode is safe or expected. We can consider ways to surface in the UI that users may need to clear site data in order to get the site to 'forget desktop mode'.
,
Aug 18
> I do not believe that automatically clearing site data upon enabling device mode is safe or expected Of course not!! That would be ridiculous. > We can consider ways to surface in the UI that users may need to clear site data And that too. That wouldn't necessarily "fix" the issue for all cases, and the user may have reasons for not wanting to do that (as if you told me I had to clear my history in order to emulate a freaking mobile device!!) > To address this issue completely, we would need to cover all ways that a site could store data on the client side No, all you have to do is have two completely isolated environments for everything: cookies, cache, storage, etc., as if the real desktop and the emulated mobile device were two... different devices! It seems pretty obvious that that is the only sensible and safe way of emulating a different device. There *may* be some things that it's not completely obvious whether one prefers to share or keep separated between the separate devices (e.g. history, though I think the obvious answer would be to treat them like two separate devices whose history syncs if the user logs in in both deviced - but different people might have different preferences), so those might be configurable in advanced settings; but the default should be for each device (real and emulated) to have its own "box".
,
Nov 16
|
||||
►
Sign in to add a comment |
||||
Comment 1 by paulir...@chromium.org
, Jul 922.0 KB
22.0 KB View Download
68.8 KB
68.8 KB View Download