Registry / serialization / ua-is-frozen

ua-is-frozen

JSON →
library0.1.2jsnpmunverified

The `ua-is-frozen` package provides a lightweight, focused utility function, `isFrozenUA`, designed to detect if a given user-agent (UA) string conforms to the "frozen" or "reduced" patterns enforced by modern browsers, particularly in response to initiatives like Chromium's User-Agent Reduction. It helps developers identify whether a UA string has been intentionally simplified or obscured by the browser to limit fingerprinting. Currently at version 0.1.2, this library is a specific-purpose tool, not a comprehensive UA parser. Its release cadence is expected to be infrequent, primarily aligning with significant changes in browser UA policies rather than regular feature cycles. Key differentiators include its single responsibility, direct boolean output, and lightweight footprint, offering a simple programmatic check for a complex and evolving web standard without the overhead of full UA string analysis. It ships with TypeScript types, facilitating its use in modern JavaScript projects.

npm install ua-is-frozen
INSTALL
IMPORT
SIG · UA-IS-FROZEN
U
ua-is-frozen
serializationjavascriptv0.1.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

isFrozenUA
import { isFrozenUA } from 'ua-is-frozen';
const { isFrozenUA } = require('ua-is-frozen');
The package is ESM-first. While CommonJS environments might resolve it, direct `require` with destructuring can be problematic in pure ESM setups. TypeScript users get types automatically alongside the runtime value.

Demonstrates how to use `isFrozenUA` to test various user-agent strings against the frozen UA pattern, showing examples of both frozen and unfrozen UAs.

import { isFrozenUA } from 'ua-is-frozen'; const oldChrome = "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.1234.56 Safari/537.36"; const newChrome = "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.0.0 Mobile Safari/537.36"; const firefox = "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/111.0"; const safari = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Safari/605.1.15"; console.log(`Old Chrome UA ('${oldChrome}') is frozen: ${isFrozenUA(oldChrome)}`); console.log(`New Chrome UA ('${newChrome}') is frozen: ${isFrozenUA(newChrome)}`); console.log(`Firefox UA ('${firefox}') is frozen: ${isFrozenUA(firefox)}`); console.log(`Safari UA ('${safari}') is frozen: ${isFrozenUA(safari)}`);
Debug
Known issues
gotchaUser-agent string freezing patterns are defined by browser vendors and can evolve over time. This library's logic is based on the current understanding of these patterns (e.g., Chromium's UA reduction). Future changes to browser UA policies might require an update to the library's internal logic, potentially leading to incorrect classifications if not kept up-to-date.
fix
Ensure the `ua-is-frozen` package is regularly updated to incorporate the latest browser UA freezing patterns and maintain accurate detection.
affects: >=0.1.0
gotchaThis library *only* checks for the frozen UA pattern; it does not parse or extract detailed information from the user-agent string (e.g., browser name, version, OS). For full UA parsing, consider dedicated libraries.
fix
If you need detailed information beyond the freeze status, use `ua-is-frozen` in conjunction with a comprehensive user-agent parsing library (e.g., `ua-parser-js`).
affects: >=0.1.0
gotchaAs of v0.1.2, the library's internal logic might be highly optimized for the most common frozen UA patterns, primarily those related to Chromium's reduction efforts. Edge cases or less common browser UAs may not be perfectly covered if their freezing patterns differ significantly.
fix
Thoroughly test with a wide range of your target user-agent strings, especially for less common browsers or specific mobile devices, to confirm expected behavior.
affects: >=0.1.0
Errors
Common errors & fixes
TypeError: isFrozenUA is not a function
The `isFrozenUA` function was not correctly imported or the package was not installed.
fix
Ensure `ua-is-frozen` is installed (`npm install ua-is-frozen`) and imported using `import { isFrozenUA } from 'ua-is-frozen';`.
ReferenceError: isFrozenUA is not defined
Similar to `TypeError`, often occurs when using CommonJS `require` in an ESM context or vice-versa without correct transpilation or build setup.
fix
Verify your module system configuration. For ESM, use `import { isFrozenUA } from 'ua-is-frozen';`. If in a CommonJS environment, ensure your bundler or Node.js version supports ESM modules or use dynamic import.
Argument of type 'number' is not assignable to parameter of type 'string'.
You are attempting to pass a non-string value to the `isFrozenUA` function, which expects a string user-agent.
fix
Always ensure the argument provided to `isFrozenUA` is a valid user-agent string (e.g., `isFrozenUA(myUserAgentString)`).
Upgrade
Version history
0.1.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
6
OpenAI (training)
2
Resources
ua-is-frozen — npm install ua-is-frozen · libregistry