Download Latest Version v2.5.0 source code.zip (170.0 kB) Google Add to Preferred Sources
Home / v2.4.0
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2026-09-28 4.4 kB
v2.4.0 source code.tar.gz 2026-09-28 134.0 kB
v2.4.0 source code.zip 2026-09-28 154.6 kB
Totals: 3 Items   293.0 kB 0

Minor Changes

  • #420 ae62c7b Thanks @matthewhudson! - Improve device detection, measured against the Matomo device-detector fixtures (35,777 user agents): correctly typed user agents go from 84% to 89%.

  • Android TV. Android TVs, Google TV, Fire TV, Chromecast, Sony Bravia, Xiaomi Mi TV and Android set-top boxes were detected as Android tablets (or phones). device.television() is now true for them, device.androidPhone(), device.androidTablet(), device.mobile() and device.tablet() are false, device.type is 'desktop' as for every television, and the <html> classes are android television instead of android tablet. device.os stays 'android'. Detection went from 2% to 48% of the Android TV fixtures; the rest only carry a bare model number.

  • Other televisions. Vizio SmartCast, Hisense VIDAA, Opera TV, Vestel-based sets and TVs running Opera's OMI browser were detected as Linux desktops. They now report os: 'television'.
  • Feature phones and other handsets. Java ME (MIDP/CLDC), Symbian, Nokia Series 40/60, MediaTek MAUI, Openwave and WAP browsers, UC Browser and Opera Mini, NTT DoCoMo, Samsung Bada, Tizen, Sailfish and Palm webOS phones were detected as desktops. device.mobile() is now true for them, device.type is 'mobile' and <html> gets the mobile class; device.os is 'unknown'. Linux-based phones (Tizen, Sailfish) no longer count as device.linux().
  • Android tablets whose browser says "Mobile". Chrome adds "Mobile" on screens narrower than 600dp, which includes many 7" and 8" tablets. Well-known tablet families (Galaxy Tab SM-T/SM-P/SM-X, Lenovo TB-, "Tab 3", Huawei MediaPad/MatePad, Kindle Fire, and the /apad token of Yandex apps) are now tablets. Android tablet detection went from 81% to 85%.
  • Android apps on Chromebooks (an Android user agent naming the Chromebook) were Android tablets. They now report os: 'chromeos', type: 'desktop' and the chromeos desktop classes; device.android() stays true.
  • Windows Mobile and Windows CE handsets (IEMobile, Windows CE) and Internet Explorer on Windows Phone 8.1 in desktop mode (WPDesktop, previously a Windows tablet) are now Windows phones.
  • Fix: a TV whose maker name contains "mac" (Atmaca/Sunny) was detected as macOS.

Known limitation: a phone whose model name contains "TV" as a separate word (for example "KAZAM TV 45") is now detected as a television.

Patch Changes

  • #420 ae62c7b Thanks @matthewhudson! - Fix five long-standing detection reports:

  • iPhone in "Request Desktop Website" mode (#363) was an iPad: Safari sends the Mac user agent, and the touchscreen check could not tell the two apart. The screen size now does: a phone-sized screen is iphone()/mobile(), an iPad-sized (or unknown) one stays ipad()/tablet().

  • iPad inside a Cordova app that reports an iPhone user agent (#106) is now ipad()/tablet() when the screen is iPad-sized.
  • Huawei and Honor tablets whose user agent only carries a model code such as VRD-W09 or BAH4-W09 and says Mobile (#362) were phones. Model codes ending in -W09 (Wi-Fi tablets; phones use -L09/-AL00) are now tablets. A HarmonyOS tablet in that situation also got the harmonyos mobile classes while device.type was 'tablet'; the classes now follow device.type.
  • Foldable phones unfolded (#332): Chrome drops Mobile on the wide inner screen, so a Galaxy Z Fold or Pixel Fold was a tablet. Both families are now phones whatever the fold state.
  • Windows touch-screen laptops in Internet Explorer (#64) were tablets because IE said Touch on every touch device. windowsTablet() now also requires ARM, i.e. a Windows RT device (#89). Modern browsers on Windows never say Touch, so a Surface in Edge, Chrome or Firefox stays desktop, as before.

The README gains a "Limitations" section that covers these cases and that device.type/device.os are computed once at import and do not follow window resizes (#273).

Source: README.md, updated 2026-09-28