Bug 1918307 - Allow keyword exposures to be recorded for a subset of exposure results. r=mak

Depends on D221912

Differential Revision: https://phabricator.services.mozilla.com/D221916
This commit is contained in:
Drew Willcoxon
2024-09-12 23:45:42 +00:00
parent 21dfca244b
commit 405e2eb591
5 changed files with 90 additions and 29 deletions

View File

@@ -1237,12 +1237,13 @@ class TelemetryEvent {
// its update process, but we should record at most one exposure per result.
if (!this.#exposureResults.has(result)) {
this.#exposureResults.add(result);
let resultType = lazy.UrlbarUtils.searchEngagementTelemetryType(result);
this.#exposures.push({
resultType,
weakResult: Cu.getWeakReference(result),
resultType: lazy.UrlbarUtils.searchEngagementTelemetryType(result),
keyword:
lazy.UrlbarPrefs.get("recordKeywordExposures") &&
!queryContext.isPrivate
!queryContext.isPrivate &&
lazy.UrlbarPrefs.get("keywordExposureResults").has(resultType)
? queryContext.trimmedLowerCaseSearchString
: null,
});