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

Issue 712819 link

Starred by 6 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

Navigation preload may break the devtools user agent override

Project Member Reported by claywoolam@google.com, Apr 18 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36

Steps to reproduce the problem:
1. Navigate to the desktop version of a page with navigation preload set up. In our case, the server decides whether to serve a desktop or mobile version of the page based on the user agent.
2. Go into chrome devtools and enable "Toggle Device Toolbar"
4. Reload the page (server should serve the mobile version now based on the user agent) and see the desktop version still shown

Note: Our serviceworker fetch handler doesn't do anything special, it's just a passthrough.

What is the expected behavior?
Mobile version of the page is shown, due to the User-Agent override.

What went wrong?
I'm not sure. The User-Agent shown under the Headers tab is "User-Agent:Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Mobile Safari/537.36", but when I look at the same request that's going on in chrome://net-internals it shows my desktop UA which is "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36".

Did this work before? No 

Chrome version: 57.0.2987.133  Channel: stable
OS Version: OS X 10.12.4
Flash Version: 

When I disable the serviceworker or install a serviceworker without the navigationpreload setup, the request/response cycle works as expected.
 

Comment 1 by caseq@chromium.org, Apr 19 2017

Cc: allada@chromium.org
Components: -Platform>DevTools Platform>DevTools>Mobile Platform>DevTools>Network
Labels: -OS-Mac OS-All
Owner: dgozman@chromium.org
Status: Assigned (was: Unconfirmed)
Cc: -allada@chromium.org dgozman@chromium.org horo@chromium.org
Components: Blink>ServiceWorker
Owner: allada@chromium.org
+horo@ for visibility.
Project Member

Comment 3 by sheriffbot@chromium.org, Jul 19 2017

Labels: Hotlist-Google
This seems similar to the the Plznavigate + DevTools issues like  issue 749884  and  issue 746220 . Nav preload occurs on navigation and probably there's no plumbing for it to respect the DevTools settings on the foreground tab.
Owner: dgozman@chromium.org
Cc: allada@chromium.org jakearchibald@chromium.org
 Issue 709838  has been merged into this issue.
Owner: caseq@chromium.org
Owner: jarhar@chromium.org
claywoolam@ I'm not able to reproduce this on Mac, can you try to reproduce this again?

Sign in to add a comment