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

Issue 741575 link

Starred by 4 users

Issue metadata

Status: Archived
Owner:
Last visit > 30 days ago
Closed: Dec 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

UserAgent inside ServiceWorker does not match the emulated one (mobile device)

Reported by alex.alv...@marfeel.com, Jul 12 2017

Issue description

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

Steps to reproduce the problem:
1. Open a site in chrome emulating a mobile device
2. Check window.navigator.userAgent with the console in the window context (e.g Nexus 6P "Mozilla/5.0 (Linux; Android 5.1.1; Nexus 6 Build/LYZ28E) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Mobile Safari/537.36")
3. Check self.navigator.userAgent in the service worker context (e.g Nexus 6P "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36")

What is the expected behavior?
The userAgent must be consistent in all the contexts (service worker, window) while we are emulating a device

What went wrong?
The userAgent is correctly set in the window context while you are emulating a mobile device but is not overrided in the service worker context (keeping the computer one)

Did this work before? N/A 

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

Comment 1 by alph@chromium.org, Jul 12 2017

Owner: chenwilliam@chromium.org
Status: Assigned (was: Unconfirmed)
Cc: dgozman@chromium.org
Status: Archived (was: Assigned)
Any reason why this has been archived?

Sign in to add a comment