Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a simple index page with OpenSearch metadata #18

Open
romulof opened this issue Jul 3, 2019 · 2 comments
Open

Create a simple index page with OpenSearch metadata #18

romulof opened this issue Jul 3, 2019 · 2 comments

Comments

@romulof
Copy link

romulof commented Jul 3, 2019

With this metadata browsers can suggest to add mdn.io as a search engine.

For example, here is how Firefox presents it:
https://support.mozilla.org/en-US/kb/add-or-remove-search-engine-firefox#w_add-a-search-engine-from-the-address-bar

To add it, simply add in your index page:

<link rel="search"
      type="application/opensearchdescription+xml"
      href="https://mdn.io/opensearch.xml"
      title="MDN Web Docs"
/>

And host /opensearch.xml that should be something like this:

<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
                       xmlns:moz="http:/www.mozilla.org/2006/browser/search/"
>
    <ShortName>MDN Web Docs</ShortName>
    <Description>Search MDN Web Docs</Description>
    <InputEncoding>UTF-8</InputEncoding>
    <Image width="16" height="16" type="image/png">
        https://developer.mozilla.org/static/img/favicon32.7f3da72dcea1.png
    </Image>
    <Url type="text/html" method="get" template="http://mdn.io/{searchTerms}" />
    <moz:SearchForm>http://mdn.io</moz:SearchForm>
</OpenSearchDescription>

More info here: https://developer.mozilla.org/en-US/docs/Web/OpenSearch

@blakeembrey
Copy link
Collaborator

Sounds like a great idea, first we'd need an index page! 😄 Would love to accept a PR for something basic. I'm assuming this would require someone to navigate to the index page first?

@tricki
Copy link

tricki commented Feb 25, 2021

In Chrome (don't know about other browsers yet) you can add a custom search engine to set a text shortcut.

Go to chrome://settings/searchEngines add a custom keyword (shortcut, e.g. "md") and the URL https://mdn.io/%s.

See https://support.google.com/chrome/answer/95426?hl=en#ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants