Skip to content
This repository was archived by the owner on Jul 10, 2018. It is now read-only.

Feature: Add OpenSearch support to the package search #429

Open
cristianl opened this issue Jun 7, 2018 · 0 comments
Open

Feature: Add OpenSearch support to the package search #429

cristianl opened this issue Jun 7, 2018 · 0 comments

Comments

@cristianl
Copy link

This allows browsers to automatically add search engines from visited websites.

Why

Some browsers, such as Safari, only support custom search engines from websites that implement OpenSearch.

In some browsers, the user experience of adding a custom search engine is improved for websites supporting OpenSearch: the user does not have to figure out the pattern of search URLs for that website, and there's no need for some third-party browser extension or search engine definition.

Implementation

This requires a link tag in the head element, and a XML file describing the search URL format.

In GitHub, the element is:

<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub">

And the XML file:

<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
                       xmlns:moz="http://www.mozilla.org/2006/browser/search/">
  <ShortName>GitHub</ShortName>
  <Description>Search GitHub</Description>
  <InputEncoding>UTF-8</InputEncoding>
  <Image width="16" height="16" type="image/x-icon">https://github.com/favicon.ico</Image>
  <Url type="text/html" method="get" template="https://github.com/search?q={searchTerms}&amp;ref=opensearch"/>
  <moz:SearchForm>https://github.com/search</moz:SearchForm>
</OpenSearchDescription>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant