Format text in Chrome Omnibox

I am creating a chrome extension that will add some search results (when using a keyword) in chrome omnibox. The available API is documented here .

This page indicates:

Offers can be richly formatted in various ways.

And you also see in the screenshot that some of the text they entered is green and the rest is black by default.

I opened my sample file and see that green is created using the HTML tag. This is very useful, but it sounds like there are plenty of other tags available. Does anyone know how I can detect these tags - I cannot find it in the documentation anywhere.

+4
source share
1 answer

HTML is not supported by the Omnibox API. The green color comes from the <match> .

In addition, valid tags are explicitly specified in the documentation for the SuggestResult type:

SuggestResult
(an object)
Suggest a result.

SuggestResult Properties

content (string)
The text that is placed in the URL string is sent to the extension when the user selects this entry.

description (string)
The text displayed in the URL drop-down list. May contain XML style markup for styles. Supported tags: url '(for a literal URL), matching ' (to highlight text that matches the user's request), and " dull " (for dull auxiliary text). Styles can be nested, for example. dimmed match.

+4
source

Source: https://habr.com/ru/post/1439182/


All Articles