privacy-sandbox-dev-support icon indicating copy to clipboard operation
privacy-sandbox-dev-support copied to clipboard

Chrome 97 On Android 10 - navigator.userAgentData Undefined

Open bvallance opened this issue 3 years ago • 4 comments
trafficstars

I'm using Chrome 97 on Android 10 (a Samsung Galaxy S9+). When I enable remote debugging and enter navigator.userAgentData in the Chrome DevTools Javascript console I get a return of undefined. Am I missing some configuration in Chrome 97 for Android? CanIUse.com reports that Chrome for Android supports userAgentData as of v90.

bvallance avatar Jan 17 '22 17:01 bvallance

Hi Bill

Sorry to hear this isn't working!

I've tried this out in Chrome 97.0.4692.87 on Android 12 but I can't reproduce the error (i.e. it works for me). I don't have a Samsung Galaxy on hand — FWIW I tried an S9+ with DevTools on BrowserStack, and that seemed to work, but that may not be realistic.

I think you should try once more, using navigator.userAgentData from DevTools and, if it still doesn't work, then file a bug via crbug.com/new.

Sam

samdutton avatar Jan 18 '22 10:01 samdutton

It would also be helpful if you could share the output from the demo page here: https://user-agent-client-hints.glitch.me/javascript.html

I did notice though, and I'll look into details on this, navigator.userAgentData is only available when you're inspecting an actual web page. So, if you're using the console to inspect something like the new tab page at chrome-native://newtab/ or about:blank then you will get undefined as if you look at the the navigator object in the console, you will see that fewer APIs are available.

rowan-m avatar Jan 18 '22 10:01 rowan-m

And to expand, navigator.userAgentData requires a secure context, e.g. https://…. So, you will not see it available on insecure http:// pages or internal browser pages as well.

rowan-m avatar Jan 18 '22 13:01 rowan-m

@rowan-m, Thanks for the reminder about using https://. That was the problem. Everything's working as expected now.

bvallance avatar Jan 18 '22 15:01 bvallance

Great to hear - let's close here.

miketaylr avatar Feb 03 '23 17:02 miketaylr