Files
danbooru/app/views/static/opensearch.xml.erb
evazion 9a03582513 Add OpenSearch suggestion support.
Add autocomplete support when searching Danbooru from the Chrome address
bar. If you type "danb<tab>" in the address bar then search for a tag,
then autocomplete results from Danbooru will appear as search
suggestions in Chrome.

Note that the "Autocomplete searches and URLs" Chrome setting must be
enabled for this to work.

Ref:

* http://dev.chromium.org/tab-to-search
* https://developer.mozilla.org/en-US/docs/Archive/Add-ons/Supporting_search_suggestions_in_search_plugins
* https://github.com/dewitt/opensearch/blob/master/mediawiki/Specifications/OpenSearch/Extensions/Suggestions/1.1/Draft%201.wiki
2020-07-04 17:52:53 -05:00

9 lines
604 B
Plaintext

<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName><%= Danbooru.config.app_name %></ShortName>
<Description><%= Danbooru.config.app_name %> search</Description>
<Image height="16" width="16" type="image/x-icon"><%= root_url %>favicon.ico</Image>
<Url type="text/html" template="<%= posts_url %>?tags={searchTerms}&amp;utm_source=opensearch"/>
<Url type="application/x-suggestions+json" template="<%= autocomplete_index_url(format: :json) %>?query={searchTerms}&amp;type=tags&amp;variant=opensearch"/>
</OpenSearchDescription>