Download Latest Version v2.6.0 source code.zip (180.2 kB) Google Add to Preferred Sources
Home / v2.6.0
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2026-10-29 1.2 kB
v2.6.0 source code.tar.gz 2026-10-29 160.2 kB
v2.6.0 source code.zip 2026-10-29 180.2 kB
Totals: 3 Items   341.6 kB 0

Minor Changes

  • #440 73af9d5 Thanks @matthewhudson! - Add current-device/core, an entry point with no side effects on import, for scripts that run on pages they don't own. Importing current-device adds generic class names such as mobile and desktop to <html>, which can collide with the page's own CSS. current-device/core exports createDevice({ classPrefix }): calling it adds the classes with the given prefix (cd-ios cd-iphone cd-mobile cd-portrait), starts the orientation listener and returns a device object with the whole API. The prefix applies to every class, the orientation classes included. The returned object is not assigned to the device global, and the user agent is read when createDevice() is called rather than at import, which also makes detection easy to unit-test. Without a DOM it returns the same 'unknown' device as the main entry point. The main entry point, the <script> build and current-device/react are unchanged.
Source: README.md, updated 2026-10-29