browser-fingerprint-pool — Random UA / Resolution Pool
Real-world browser market share User-Agent and screen resolution data pool. Pure data + pure functions (Node ESM, zero dependencies). Extracted from caijiqi-kaifa/electron/data/user-agents.ts and resolutions.ts.
Use Cases
- Randomize request identity during web automation / data scraping to reduce risk detection probability
- Need to pick UA by browser type (Chrome / Firefox / Edge / Safari / Opera)
- Need to randomly select screen resolution weighted by market share (mainstream resolutions appear more frequently)
Usage
import { getRandomUserAgent, getUserAgentByType, allUserAgents,
getRandomResolution, getRandomResolutionString, parseResolution, uniqueResolutions }
from './scripts/fingerprint-pool.mjs';
getRandomUserAgent(); // Random UA
getUserAgentByType('firefox'); // UA by type
allUserAgents.length; // 88+
getRandomResolution(); // { width, height }
getRandomResolutionString(); // '1920x1080'
parseResolution('1366x768'); // { width:1366, height:768 }
uniqueResolutions; // Deduplicated resolution list (for UI display)
Core API
allUserAgents: Merged array of all UAs (88+)getRandomUserAgent(): Pick a random UAgetUserAgentByType(type):'chrome' | 'firefox' | 'edge' | 'safari' | 'opera' | 'random'allResolutions: Array of weighted duplicate resolution strings (87)getRandomResolution()/getRandomResolutionString()parseResolution(str):'1920x1080' → { width, height }uniqueResolutions: Deduplicated resolution list
Notes
- This skill only provides "identity data", not injection logic; combine it with
playwright-stealthto actually write into the browser context. - All data is local, no network calls.