Urgent.News

650+ sources. One page. See who else covered it.

Editions

Tech

What the browser can actually tell you about your hardware (and what it can't)

I spent a while building browser-based hardware diagnostics and came away with a much clearer sense of where the web platform is genuinely capable and where it quietly lies to you. Notes below, with live demos for each API so you can poke at them yourself. Refresh rate: requestAnimationFrame is the only signal you get There's no screen.refreshRate . The only approach is timing…

Building browser-based hardware diagnostics led to understanding where web platform capabilities are genuine and where they mislead. The refresh rate signal is limited to requestAnimationFrame, with no direct screen.refreshRate. The only way to estimate it is by timing requestAnimationFrame callbacks and calculating median frame delta.

There are two pitfalls: averaging can be affected by a single dropped frame, and rAF is throttled in background tabs, rendering tab-invisibility measurements meaningless. Screen dimensions have four different answers, all valid. screen.width, window.innerWidth, window.devicePixelRatio, and screen.availWidth measure distinct aspects, with screen.width * devicePixelRatio representing the actual native panel resolution.

However, this does not reveal true hardware resolution. Keyboard event.code vs event.key comparison shows event.key being layout-dependent while event.code corresponds to physical position. Certain keys, like PrintScreen, lack JS detection, and Meta combinations might be obscured by the OS. N-key rollover testing exhibits a Set size growth pattern when simultaneously held keys are monitored.

Pointer events unify mouse, touch, and pen inputs, with pointerId facilitating multi-touch tracking. Measuring the gap between consecutive pointerdown events on the same button can detect worn-switch double-click faults. PreventDefault() on pointerdown halts compatibility mouse events, potentially breaking code expecting them. Gamepad API is polling-based and dormant until user interaction, with axis movement not being event-driven.

This causes a one-hour confusion regarding resting axis values indicating potential orientation defects. Media device labels are gated behind permission, revealing empty strings before getUserMedia() success. For microphone level metering, AnalyserNode with getByteTimeDomainData and RMS computation is more stable than frequency data.

Dead pixels cannot be detected programmatically, necessitating visual inspection through Fullscreen API and solid-color viewport filling. Despite these limitations, these APIs offer relative measurements, permission-protected labels, and input-protected device lists, serving as the right trade-off for fingerprinting resistance. The full set of demos can be found here for further comparison.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Four patterns that keep my YouTube longform JSON queue from going stale

I manage the YouTube longform queue for my BuilderStack channel as JSON files in content/yt-longform-queue/ . A spec file lands there when a generator script commits a new dialogue; the publish…

  • YouTube longform queue operates as a JSON file in content/yt-longform-queue directory
  • Explicit priority rank ensures product walkthroughs are published before recaps
  • 21-day stale expiry removes long-pending specs to maintain manageable queue

Code Review From the Terminal and CI, No MCP Client Required

A month ago I shipped aicraft-code-review , an MCP server that reviews code locally. This week I added a CLI mode — because not everyone wants to wire up an MCP client just to check a diff.

  • Tool allows code review in terminal without MCP client
  • Three modes: Claude Code, Cursor, or CLI via mcp-code-review
  • Compatible with CI systems, outputs 0/1/2 exit codes

More from Sunday 16 August →