Fetch New Tab ads through the MozAdsClient in AdsFeed
Categories
(Firefox :: New Tab Page, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox154 | --- | fixed |
People
(Reporter: ahanot, Assigned: ahanot)
References
Details
Attachments
(1 file, 1 obsolete file)
Wire the New Tab AdsFeed to fetch sponsored tiles and content through the MozAdsClient singleton (added in bug 2051420) when the AdsClient feature flag is enabled.
AdsFeed.fetchDatagains an early guard: when the client is available it delegates to a new_fetchWithAdsClient; otherwise the existing legacy fetch runs unchanged._fetchWithAdsClientbuilds the placement requests and callsrequestTileAds/requestSpocAds, sending them over the ads-client OHTTP viaduct channel viaAdsClient.requestOptions().AdsClient.sys.mjsgains the OHTTP configuration (requestOptions/configureOhttp); the New Tab request-building glue lives inAdsFeedsoAdsClientstays the clean long-term interface.- For now the client results (canonical
MozAdsTile/MozAdsSpoc) are mapped back to the existing snake_case shape the rest of New Tab consumes. Changing the consumers to the typedMozAds*shape touches too many files, so that is deferred to a follow-up; this keeps the diff small and the legacy path untouched. - Gated behind the AdsClient flag and
unifiedAds.adsFeed.enabled(both off by default), so there is no shipped behavior change.
| Assignee | ||
Comment 1•2 months ago
|
||
Wire AdsFeed to fetch sponsored tiles and content through the MozAdsClient
singleton (bug 2051420) when the AdsClient flag is enabled.
- fetchData gains an early guard: when this.adsClient is set it delegates to a
new _fetchWithAdsClient; otherwise the existing legacy fetch runs unchanged,
so the legacy vs. ads-client paths stay clearly separated and legacy is easy
to remove later. - _fetchWithAdsClient builds the placement requests and calls requestTileAds /
requestSpocAds, sending them over the ads-client OHTTP viaduct channel via
AdsClient.requestOptions(). - AdsClient.sys.mjs keeps only the singleton and the reusable OHTTP config
(requestOptions/configureOhttp); the New Tab request-building glue lives in
AdsFeed so AdsClient stays the clean long-term interface.
The client returns the canonical MozAdsTile/MozAdsSpoc objects, but for now we
map them back to the existing snake_case shape the rest of New Tab consumes.
Switching the consumers to the typed MozAds* shape touches too many files, so
that is left for a follow-up; this keeps the diff small and the legacy path
untouched.
Gated behind the AdsClient flag and unifiedAds.adsFeed.enabled, both off by
default, so there is no shipped behavior change.
Updated•2 months ago
|
| Assignee | ||
Comment 2•2 months ago
|
||
Wire AdsFeed to fetch sponsored tiles and content through the MozAdsClient
singleton (bug 2051420) when the AdsClient flag is enabled.
- fetchData gains an early guard: when this.adsClient is set it delegates to a
new _fetchWithAdsClient; otherwise the existing legacy fetch runs unchanged,
so the legacy vs. ads-client paths stay clearly separated and legacy is easy
to remove later. - _fetchWithAdsClient builds the placement requests and calls requestTileAds /
requestSpocAds, sending them over the ads-client OHTTP viaduct channel via
AdsClient.requestOptions(). - AdsClient.sys.mjs keeps only the singleton and the reusable OHTTP config
(requestOptions/configureOhttp); the New Tab request-building glue lives in
AdsFeed so AdsClient stays the clean long-term interface. - Expose the generated RustViaduct.sys.mjs bindings via MOZ_SRC_FILES so the
OHTTP channel configuration (configureOhttpChannel/OhttpConfig) can be loaded.
The client returns the canonical MozAdsTile/MozAdsSpoc objects, but for now we
map them back to the existing snake_case shape the rest of New Tab consumes.
Switching the consumers to the typed MozAds* shape touches too many files, so
that is left for a follow-up; this keeps the diff small and the legacy path
untouched.
Gated behind the AdsClient flag and unifiedAds.adsFeed.enabled, both off by
default, so there is no shipped behavior change.
Updated•2 months ago
|
Comment 4•2 months ago
|
||
| bugherder | ||
Updated•1 month ago
|
Description
•