Add OpenSearch support (/opensearch.xml).

Add https://danbooru.donmai.us/opensearch.xml. This file tells browsers
how to perform searches on Danbooru.

In Chrome, this lets you type "danb<tab>" in the address bar to perform
a search on Danbooru.

In Firefox, you have to click the "..." icon next to the address bar,
then choose "Add Search Engine". After that, you can search Danbooru
from the address bar.

Ref:

* http://dev.chromium.org/tab-to-search
* https://developer.mozilla.org/en-US/docs/Web/OpenSearch
* https://github.com/dewitt/opensearch/blob/master/opensearch-1-1-draft-6.md
* https://en.wikipedia.org/wiki/OpenSearch
This commit is contained in:
evazion
2020-07-04 17:25:45 -05:00
parent b6b0218e1d
commit aa1a21aece
5 changed files with 20 additions and 0 deletions

View File

@@ -63,4 +63,11 @@ class StaticControllerTest < ActionDispatch::IntegrationTest
assert_response :success
end
end
context "opensearch action" do
should "work" do
get opensearch_path, as: :xml
assert_response :success
end
end
end