SShortSingh.
Back to feed

Why browser extension UIs break on many sites and how a Shadow DOM wrapper fixes it

0
·13 views

Badges injected by browser extension content scripts often render incorrectly on real websites, appearing oversized, misplaced, or missing controls. The problem stems from aggressive global CSS resets, utility classes, and broad element selectors on supermarket web shops that leak into extension widgets. The author, while building the open-source ShrinkWatch EU extension, found a fix by placing the widget inside a Shadow DOM with a reset host element and self-contained styles. The approach also recommends fixed pixel units instead of rem, and attaching the host to the document root so page navigation or body transforms do not disrupt its positioning. The author reports that since version 0.3.2 the badge has looked consistent across the shops tested in a real browser.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Why Cross-Border Search Needs More Than Query Translation

Translating a search query once does not make retrieval work across languages, because tokenization, morphology, character normalization and word order all change what documents get matched. Languages such as Chinese, Japanese and Thai are written without spaces, so whitespace splitting turns whole sentences into single unmatched terms. Inflected languages like German, Russian and Arabic need stemming, or plural and case forms will never match each other. The article proposes a three-layer architecture of language-specific analysis, vector alignment and localized ranking, noting that omitting any layer leaves recall gaps in some languages. It also recommends keeping filters such as currency, dates and compliance rules separate from relevance scoring and measuring effectiveness per language rather than in blended averages.

0
ProgrammingDEV Community ·

UUIDv7 Offers Database Speed but Its Embedded Timestamp Is Not a Reliable Clock

UUIDv7 identifiers are gaining favor because they keep database indexes efficient while staying unique without central coordination. Each ID embeds a millisecond timestamp, which means anyone who sees an ID can roughly infer when it was created. A reproduction described in an October 19, 2026 post showed that the embedded time can drift from the real clock, running about an hour ahead after the system clock was set back. The RFC allows implementations to adjust the timestamp, so it should be treated as a hint rather than an accurate record. Developers debate whether exposing this metadata matters, with the author recommending UUIDv7 internally while avoiding exposing it in sensitive public-facing contexts.

0
ProgrammingDEV Community ·

Pre-commit hook fixed to check staged translation files, not working tree

The author's Locale Guard tool, a GitHub Action and CLI for translation files, added a pre-commit hook in version 1.3.0. The first version of that hook checked files on disk, so it approved a commit that held an English key but lacked matching entries in other language files. The fix makes the check read staged content directly from git, so incomplete commits are now blocked. A pre-push hook and the pull request check were also added to catch anything skipped with --no-verify. Demo repositories for Husky and Lefthook are available for testing.

0
ProgrammingDEV Community ·

What spec-driven development is and why AI coding tools are splitting into competing camps

The article explains spec-driven development (SDD), where requirements are written as a clear document that AI agents work from rather than from chat memory. It describes three traits of SDD: specs are version-controlled files, humans approve them before code is written, and every implementation step can be traced back to the spec. The author notes that the real differences between SDD tools lie in how specs relate to verification, not in feature counts. Three maturity levels are outlined: spec-first, spec-anchored, and spec-as-source, each answering differently who judges whether code is correct. The piece is the first part of a series comparing these tools.