fnando / browser

Do some browser detection with Ruby. Includes ActionController integration.
MIT License
2.45k stars 361 forks source link

Fix missing detection for many Kindle Fire devices #540

Closed a5ob7r closed 6 months ago

a5ob7r commented 1 year ago

The previous regex to detect Kindle Fire devices is incomplete, so it can only detect Kindle Fire (1st Gen) and Kindle Fire HD 7 (2nd Gen). The reason why is that it uses a device specific identifier, which is referenced as Build Model in the document.

We can fix this problem by using the more generalized regex to detect many other Kindle Fire devices. The regex is from the official document, but with a little tweaking for simplification. The original regex is for not only detecting the devices but also extracting Build Models and version number of the browser, which we do not need to do them.

https://docs.aws.amazon.com/silk/latest/developerguide/detecting-silk-ua.html

Thank you for this great gem.

Best Regards.