Formatting Text in Chrome Omnibox

google-chrome-extension

Solution

HTML is not supported by the Omnibox API. The green colour comes from the use the `<match>` tag.

Furthermore, the allowed tags are clearly states in the documentation for the SuggestResult type:

SuggestResult ( object ) A suggest result.

Properties of SuggestResult

content ( string ) The text that is put into the URL bar, and that is sent to the extension when the user chooses this entry.

description ( string ) The text that is displayed in the URL dropdown. Can contain XML-style markup for styling. The supported tags are 'url' (for a literal URL), 'match' (for highlighting text that matched what the user's query), and 'dim' (for dim helper text). The styles can be nested, eg. dimmed match.

Problem

I'm building a chrome extension that will adding some search results (when using a keyword) to the chrome omnibox. The available API is documented here. On that page it states: The suggestions can be richly formatted in a variety of ways And you also see in the screenshot they have that some of the text that they've entered is green, while the rest is the default black. I've opened up their sample file, and see that the green is created using the HTML tag . That is super useful, but it makes it sound like there are a variety of other tags available. Does anyone know how I can discover these tags - I can't seem to find it in the documentation anywhere.

Original source