ua-parser / uap-go

Go implementation of ua-parser
Other
357 stars 106 forks source link

UserAgent should be renamed to Browser #60

Closed hsluoyz closed 3 years ago

hsluoyz commented 5 years ago

The current definition is:

type Client struct {
    UserAgent *UserAgent
    Os        *Os
    Device    *Device
}

I think a more accurate way would be:

type Client struct {
    Browser   *Browser
    Os        *Os
    Device    *Device
}

This is also how it's renamed in other uap implementations like uap-c++:

https://github.com/ua-parser/uap-cpp/blob/deb33d1eede74088fbcdfc2eb3e945e2d55d477c/UaParser.cpp#L305-L313

mudream4869 commented 4 years ago

The result might be a bot which is not a browser. EX: https://github.com/ua-parser/uap-core/blob/286809e09706ea891b9434ed875574d65e0ff6b7/regexes.yaml#L97