faker icon indicating copy to clipboard operation
faker copied to clipboard

RFC: Refactor random User Agents

Open prisis opened this issue 2 years ago • 3 comments

Clear and concise description of the problem

The current implementation is generating custom user agents based on some old data.

Suggested solution

The new implementation:

Create a new package "user-agent-list" that is updated on daily basis. With this we could generate realistic random user agents.

Use https://developers.whatismybrowser.com/useragents/explore/ as datasource Create a user agent string parser to object. This will add the possibility to add a option key on the new user agent function for filtering.

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36
{
  "appName": "Netscape",
  "connection": {
    "downlink": 10,
    "effectiveType": "4g",
    "rtt": 0
  },
  "platform": "Win32",
  "pluginsLength": 3,
  "vendor": "Google Inc.",
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36",
  "viewportHeight": 660,
  "viewportWidth": 1260,
  "deviceCategory": "desktop",
  "screenHeight": 800,
  "screenWidth": 1280
}

Alternative

No response

Additional context

No response

prisis avatar Jan 18 '22 12:01 prisis

I'd love to help on this

mbokinala avatar Jan 21 '22 16:01 mbokinala

Use https://developers.whatismybrowser.com/useragents/explore/ as datasource

It looks like they charge $50 AUD for access to their database (https://developers.whatismybrowser.com/useragents/database/). @prisis Is this what you were referring to or was it something else?

mbokinala avatar Jan 22 '22 20:01 mbokinala

This url was just a example, maybe we find a different source or we can try to get them as sponsor. Or I will pay the 50$ is not so much, I just need to check the license

prisis avatar Jan 22 '22 22:01 prisis