From f4eecb44134d5be186e4920a03f18c56ba6c183d Mon Sep 17 00:00:00 2001 From: James Teow Date: Wed, 19 Apr 2023 14:17:47 +0000 Subject: [PATCH] Bug 1823697 - Process adServerAttributes before check is called - r=Standard8 Differential Revision: https://phabricator.services.mozilla.com/D175783 --- browser/actors/SearchSERPTelemetryChild.sys.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/browser/actors/SearchSERPTelemetryChild.sys.mjs b/browser/actors/SearchSERPTelemetryChild.sys.mjs index 9b9be8229933..5abc4523f63d 100644 --- a/browser/actors/SearchSERPTelemetryChild.sys.mjs +++ b/browser/actors/SearchSERPTelemetryChild.sys.mjs @@ -72,6 +72,7 @@ class SearchProviders { return component; }); } + p.adServerAttributes = p.adServerAttributes ?? []; return { ...p, searchPageRegexp: new RegExp(p.searchPageRegexp), @@ -341,10 +342,9 @@ class SearchAdImpression { if (!anchor.href) { return false; } - let adServerAttributes = this.#providerInfo.adServerAttributes ?? []; let regexps = this.#providerInfo.extraAdServersRegexps; // Anchors can contain ad links in a data-attribute. - for (let name of adServerAttributes) { + for (let name of this.#providerInfo.adServerAttributes) { if ( anchor.dataset[name] && regexps.some(regexp => regexp.test(anchor.dataset[name]))