Remove device name from user agent
-
Or at least an option to set a custom or shorter user agent.
For example:
Mozilla/5.0 (Android 9; Mobile; rv:68.0) Gecko/68.0 Firefox/68.0
looks better than
Mozilla/5.0 (Linux; Android 9; SM-A202F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.137 Mobile Safari/537.36 Vivaldi/2.7.1624.163
-
@dewey The user agent shouldn't include the device name at all. This looks like a bad case for user tracking / fingerprinting.
could you file a bug report for this please? https://vivaldi.com/bugreport/
-
Reported as VB-57402
-
@dewey said in Remove device name from user agent:
VB-57402
Thanks. I confirmed the bug in the tracker.
-
The current UA format will stay put (I guess) perhaps due to some debug issues. However I noticed on latest Samsung Browser beta version that device OS detection forward in headers Android(SamsungBrowser) instead Android (Android)
-
This post is deleted! -
Hello,
Is there any info on how this bug report is?
I've tested my user agent now and the app is still leaking the device name.I fear this might have privacy implications. Can you move this up on your priorities?
-
User Agent detection is not a recommended technique for modern web apps. You can use JavaScript window.matchMedia() method to detect a mobile device based on the CSS media query.
if (window.matchMedia("(max-width: 767px)").matches) { // The viewport is less than 768 pixels wide document.write("This is a mobile device."); }
Another approach would be a responsive media query. You could presume that a mobile phone has a screen size greater than x and less than y.
For example:
@media only screen and (min-width: 320px) and (max-width: 600px) {}
You may also use navigator.userAgentData.mobile .
const isMobile = navigator.userAgentData.mobile;