SmartBlock Shims: Click-to-Load Placeholders for Blocked Tracker Content
SmartBlock is Firefox’s system for handling blocked third-party content gracefully. When Enhanced Tracking Protection blocks a tracker, SmartBlock replaces the would-be-loaded element with a styled click-to-load placeholder, so users see that something was blocked rather than facing an invisible hole in the page. The placeholder is generated by per-tracker JavaScript shims that mimic the shape of the original element. This section covers three patches against the SmartBlock surface.
The patches
Facebook Post Shim — Bug 1698840 | D275716. Facebook’s XFBML system uses <div class="fb-post"> elements that get processed by the Facebook SDK at page-load time. When Firefox’s Enhanced Tracking Protection (Strict mode) blocks the SDK, these elements never get processed and render as nothing. Users have no signal that a post was supposed to be there.
Firefox already had a SmartBlock shim for the Facebook SDK covering login buttons and video embeds, but fb-post elements were not handled. I extended facebook-sdk.js with a makePostPlaceholder() function that detects fb-post elements at load time, generates a styled placeholder with the original post URL extractable from the element’s attributes, and renders a click-to-load button that loads the real SDK on demand. The shim runs early enough in the page-load pipeline that the placeholder appears before the user notices the gap. Reviewer: manuel. Landed December 9, 2025.
Localizing the SmartBlock Embed Header — Bug 2026331 | D295198. The embed link preservation work shipped earlier in the internship injects a header above the preserved content that reads “Original embed content.” That string had been hardcoded English in the helper file. Firefox ships in over a hundred locales, and none of them were getting the translated version. This patch moved the string into the relevant .ftl file in the SmartBlock locale directory, so translators pick it up on the next translation cycle, and updated the injection site to use the Fluent reference. Reviewers: manuel, fluent-reviewers, webcompat-reviewers, twisniewski, flod. Landed April 21, 2026.
Extending SmartBlock Probe Expiry — Bug 2026447 | D291234. Glean (Mozilla’s telemetry framework) requires every probe to declare an expiry as a Firefox version number. Once that version is in release and probes have rolled off the supported channels, data collection stops. The expiry exists for good reasons: stale telemetry is privacy debt. The downside is that probes can quietly expire while the team that depends on them is still using the data.
Several SmartBlock probes were close to expiry while still feeding dashboards the privacy team uses. A two-line-per-probe patch in metrics.yaml bumped the expires value to Firefox 160 (next-next major). The interesting part of this kind of patch is the operational discipline: the engineer who originally landed the probe is not always the person who notices that the expiry is approaching. Probe expiry is a class of work that benefits from a periodic audit, and shipping a bump is the cheap end of that audit. Reviewer: manuel. Landed April 16, 2026.
What this surface is
SmartBlock occupies an unusual position: a privacy feature that the user is meant to see. The blocklist is silent by design — the right behavior when a tracker is blocked is for the tracker simply not to load — but when the missing tracker is structural to the page (a Facebook post, a Twitter embed), silence becomes confusing. SmartBlock turns the absence into a visible affordance the user can choose to override. The per-tracker shims are small in lines and large in failure modes: each one runs untrusted-looking JavaScript inside the page’s context and has to integrate cleanly with whatever JavaScript the page itself is running.