зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1813302 - Add missing blockL10n property to UrlbarProviderOmnibox payload r=dao,adw
Differential Revision: https://phabricator.services.mozilla.com/D168191
This commit is contained in:
Родитель
657fe743a9
Коммит
15bb63ab92
|
@ -179,6 +179,7 @@ class ProviderOmnibox extends UrlbarProvider {
|
|||
queryContext.tokens[0].value,
|
||||
UrlbarUtils.HIGHLIGHT.TYPED,
|
||||
],
|
||||
blockL10n: { id: "urlbar-result-menu-dismiss-firefox-suggest" },
|
||||
isBlockable: suggestion.deletable,
|
||||
icon: UrlbarUtils.ICON.EXTENSION,
|
||||
}
|
||||
|
|
|
@ -1655,6 +1655,18 @@ UrlbarUtils.RESULT_PAYLOAD_SCHEMA = {
|
|||
type: "object",
|
||||
required: ["keyword"],
|
||||
properties: {
|
||||
blockL10n: {
|
||||
type: "object",
|
||||
required: ["id"],
|
||||
properties: {
|
||||
id: {
|
||||
type: "string",
|
||||
},
|
||||
args: {
|
||||
type: "array",
|
||||
},
|
||||
},
|
||||
},
|
||||
content: {
|
||||
type: "string",
|
||||
},
|
||||
|
|
|
@ -506,17 +506,22 @@ function makeOmniboxResult(
|
|||
queryContext,
|
||||
{ content, description, keyword, heuristic = false }
|
||||
) {
|
||||
let payload = {
|
||||
title: [description, UrlbarUtils.HIGHLIGHT.TYPED],
|
||||
content: [content, UrlbarUtils.HIGHLIGHT.TYPED],
|
||||
keyword: [keyword, UrlbarUtils.HIGHLIGHT.TYPED],
|
||||
icon: [UrlbarUtils.ICON.EXTENSION],
|
||||
};
|
||||
if (!heuristic) {
|
||||
payload.blockL10n = { id: "urlbar-result-menu-dismiss-firefox-suggest" };
|
||||
}
|
||||
let result = new UrlbarResult(
|
||||
UrlbarUtils.RESULT_TYPE.OMNIBOX,
|
||||
UrlbarUtils.RESULT_SOURCE.ADDON,
|
||||
...UrlbarResult.payloadAndSimpleHighlights(queryContext.tokens, {
|
||||
title: [description, UrlbarUtils.HIGHLIGHT.TYPED],
|
||||
content: [content, UrlbarUtils.HIGHLIGHT.TYPED],
|
||||
keyword: [keyword, UrlbarUtils.HIGHLIGHT.TYPED],
|
||||
icon: [UrlbarUtils.ICON.EXTENSION],
|
||||
})
|
||||
...UrlbarResult.payloadAndSimpleHighlights(queryContext.tokens, payload)
|
||||
);
|
||||
result.heuristic = heuristic;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче