| ListsFeed.sys.mjs |
Class for the Lists widget, which manages the updates to the lists widget
and syncs with PersistentCache
|
4511 |
- |
| PictureOfTheDayFeed.sys.mjs |
Picture of the Day widget - data flow overview
Fetch / render:
Once per day this feed fetches the picture from Merino (via
TemporaryMerinoClientShim), stores it in PersistentCache, maps the payload
onto our internal shape with normalize(), and broadcasts it into the Redux
store, where PictureOfTheDay.jsx renders it. The Merino backend refreshes the
picture on a daily cron (around midnight PST); when a fresh image is not
available it serves the previous day's picture rather than nothing, so the
client can legitimately receive the same picture across days. Whether the
widget runs at all is gated by isEnabled() (isWidgetEnabled: widgets container
on, the widget addable / trainhop-enabled, and the user's enabled pref).
Set as wallpaper:
The "Set wallpaper" CTA - shown only when the feature gate pref
(widgets.pictureOfTheDay.setAsWallpaper.enabled, or its trainhopConfig
override) is on AND newtabWallpapers.enabled + customWallpaper.enabled are on
- dispatches WIDGETS_PICTURE_SET_WALLPAPER. setWallpaper() then fetches the
image, derives a theme, applies it as the custom wallpaper (newtabWallpapers.*),
and records the picture's published date in
widgets.pictureOfTheDay.wallpaperActive.
State reset:
The JSX shows the "already set" checkmark only while wallpaperActive equals the
current picture's published date, so a new day's picture re-offers the CTA on
its own. wallpaperActive is also cleared when the user switches to a non-custom
wallpaper (onPrefChangedAction) or replaces the custom wallpaper with a
different image (onWallpaperUpload). Toggling wallpapers off in the Content
section does not clear it (the picture stays selected) - the JSX just hides the
checkmark while newtabWallpapers.user.enabled is off and shows it again on.
Two distinct prefs: setAsWallpaper.enabled is the config gate (does the CTA
exist); wallpaperActive stores the published date of the picture that is the
active wallpaper ("" = none).
|
13990 |
- |
| PrivacyFeed.sys.mjs |
Feed for the Privacy widget. Runs in the parent process. Reads the daily
tracker-blocked count from PrivacyMetricsService (same process, no IPC) for
the live readout, and on each new tab runs the message scheduler
(PrivacyMessages.sys.mjs) — period/streak totals come straight from
TrackingDBService so the whole feature stays trainhoppable (Bug 2050954).
|
18905 |
- |
| PrivacyMessages.sys.mjs |
Privacy widget message scheduling — catalog + selector.
The widget always shows today's tracker count. Below it, it shows ONE
secondary message — or nothing ("blank"). This module owns the catalog of
messages and the pure logic that picks which one to show on each new tab.
`PrivacyFeed` gathers the inputs (counts, streak, feature flags, persisted
state), calls `selectPrivacyMessage`, persists the returned state, and
broadcasts the decision to the component (Bug 2050954).
───────────────────────────── BUSINESS RULES ─────────────────────────────
ZERO STATE
No trackers blocked today → the empty state (shield icon, no count, no tip).
A zero *site* count is not a zero state; the component drops that line instead.
MESSAGE FAMILIES (the `category` field)
info Education about tracking / Firefox protections. shield/planet/
bolt icon by sub-theme.
promo Suggest adopting another Firefox feature (passwords, VPN,
Relay masks, sign-in, Monitor). star icon. `feature` tags it
so we can suppress promos for features already in use.
firstProtection / dailyCap / streak / milestone{Week,Month,Year,Total}
Earned "celebration" moments. kit icon.
CELEBRATIONS
firstProtection The very first time the count goes above zero (once ever).
dailyCap Today's count reaches the display cap (the "100+" ceiling).
streak Protected 3, 5, or 7 days in a row (count-block layout,
like blank but with a message + kit icon). Each of 3/5/7
fires once per streak; a broken streak re-arms them.
milestone* Cumulative total crosses a tier (see MILESTONE_TIERS):
week 100
month 250 / 500 / 1K / 2K
year 5K / 10K / 25K
total 10K / 25K
Fires on the next new tab after crossing, at most once per
day. The highest crossed tier wins; the watermark prevents
re-firing until the calendar period rolls (week/month/year)
or never (total).
FREQUENCY (ordinary info + promo only — celebrations bypass all of this)
Normal profile: ≤ 5/day, ≤ 1/hour. (day = UTC day, see below)
New profile (< 48h): ≤ 10/day, ≤ 1/15min. Anchored to profile age.
Over a limit → blank. A blank never consumes a slot (only real messages do).
"Seen" = rendered: a message counts the moment it is selected for a new tab.
BLANK CHANCE
Even when an info message is eligible, show blank `blankChance` of the time
(default 0.4, pref-controlled) for a calm, high-signal experience. Promos
are not subject to the random blank.
PROMO LIMITS (on top of the frequency rules)
≤ 1 promo/day; the same promo repeats ≤ once/month; and promos are skipped
for features the user already uses (sign-in/Sync, saved logins, Relay masks
are detectable; VPN and Monitor have no local signal so they still rotate).
PRECEDENCE (when several qualify on the same new tab)
1. empty (count 0)
2. firstProtection (once ever)
3. streak (3/5/7)
4. milestone (≤ once/day)
5. dailyCap (100+)
6. otherwise an ordinary info/promo message subject to the limits — or blank
DAY BOUNDARIES are UTC (matching how the tracker count is stored; same as
about:protections), so week/month/year totals reset on UTC boundaries.
NOTE (Bug 2048389): the catalog `id`s are real Fluent message ids; the
component resolves each as an l10n id with `countArg`. The scheduling logic
keys off `category`/`icon`/`countSource`, never the id.
|
24789 |
- |
| RecentSearchesFeed.sys.mjs |
Feed for the Recent Searches widget. Runs in the parent process.
|
2089 |
- |
| SportsFeed.sys.mjs |
Manages persistent state for the Sports widget (selected teams and widget
state), syncing with PersistentCache so state survives page refreshes.
Also fetches teams and match data from the Merino WCS endpoints.
|
47859 |
- |
| StocksFeed.sys.mjs |
Periodically fetches the default-ETF stock snapshots from Merino for HNT and
mirrors them into the `Stocks` Redux slice.
|
20907 |
- |
| TimerFeed.sys.mjs |
Class for the Timer widget, which manages the changes to the Timer widget
and syncs with PersistentCache
|
5212 |
- |