Created
April 25, 2023 22:09
-
-
Save quiiver/bf4cfb8b1e369f966fdd28a507430d74 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git i/browser/components/urlbar/UrlbarProviderQuickSuggest.sys.mjs w/browser/components/urlbar/UrlbarProviderQuickSuggest.sys.mjs | |
index a8226a637f87d..b9792aa2e695d 100644 | |
--- i/browser/components/urlbar/UrlbarProviderQuickSuggest.sys.mjs | |
+++ w/browser/components/urlbar/UrlbarProviderQuickSuggest.sys.mjs | |
@@ -227,6 +227,7 @@ class ProviderQuickSuggest extends UrlbarProvider { | |
: "firefox-suggest-urlbar-block", | |
}, | |
source: suggestion.source, | |
+ qsProvider: suggestion.provider, | |
requestId: suggestion.request_id, | |
}; | |
@@ -237,7 +238,7 @@ class ProviderQuickSuggest extends UrlbarProvider { | |
payload.subtype = RESULT_SUBTYPE.DYNAMIC_WIKIPEDIA; | |
} else if (suggestion.is_sponsored) { | |
payload.subtype = RESULT_SUBTYPE.SPONSORED; | |
- } else { | |
+ } else if (suggestion.advertiser == "wikipedia"){ | |
payload.subtype = RESULT_SUBTYPE.NONSPONSORED; | |
} | |
diff --git i/browser/components/urlbar/UrlbarUtils.sys.mjs w/browser/components/urlbar/UrlbarUtils.sys.mjs | |
index cdf98505342a5..7d114bb608254 100644 | |
--- i/browser/components/urlbar/UrlbarUtils.sys.mjs | |
+++ w/browser/components/urlbar/UrlbarUtils.sys.mjs | |
@@ -1417,7 +1417,8 @@ export var UrlbarUtils = { | |
if (source == "remote-settings") { | |
source = "rs"; | |
} | |
- return `${source}_${result.payload.subtype}`; | |
+ let subtype = result.payload.subtype || result.payload.qsProvider; | |
+ return `${source}_${subtype}`; | |
} | |
if (result.providerName === "Weather") { | |
return "weather"; | |
@@ -1617,6 +1618,9 @@ UrlbarUtils.RESULT_PAYLOAD_SCHEMA = { | |
qsSuggestion: { | |
type: "string", | |
}, | |
+ qsProvider: { | |
+ type: "string", | |
+ }, | |
requestId: { | |
type: "string", | |
}, | |
diff --git i/browser/components/urlbar/tests/quicksuggest/MerinoTestUtils.sys.mjs w/browser/components/urlbar/tests/quicksuggest/MerinoTestUtils.sys.mjs | |
index 1922ec62bd7ae..e8c8f004a2a74 100644 | |
--- i/browser/components/urlbar/tests/quicksuggest/MerinoTestUtils.sys.mjs | |
+++ w/browser/components/urlbar/tests/quicksuggest/MerinoTestUtils.sys.mjs | |
@@ -494,6 +494,7 @@ class MockMerinoServer { | |
block_id: 1, | |
advertiser: "advertiser", | |
is_sponsored: true, | |
+ provider: "adm", | |
score: 1, | |
}, | |
], |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment