Where does an OpenSearch OSDD document go?
Asked Answered
E

2

8

Does anyone have a clue what I name this XML document and where to put it now that I have it created?

I would like to provide an OSDD (OpenSearch description document) on my site so that Google Chrome will automatically pick up search capabilities for it. Google tells me that's how it is done, but not where it should be hosted. I also couldn't find any reference to the final location on the OpenSearch site. I've even tried poking around the source of places that do support it to see if it is some sort of META tag to no avail.

EDIT Well, there is one method of doing it explicitly. Now I just need to see if there is a way for it to happen automatically as it does on a number of sites (none of them have any sort of link tag): bugmenot.com, *.craigslist.org, and any others one might find when they right-click their Chrome address bar and choose "Edit search engines...".

Ear answered 31/12, 2008 at 21:49 Comment(0)
R
7

It should be stored in the root directory of you website. You just add a link to it in your webpages like this:

<link rel="search" type="application/opensearchdescription+xml" title="Stack Overflow" href="/opensearch.xml" />
Rafe answered 31/12, 2008 at 21:57 Comment(2)
I don't think it actually has to be in the root directory.Kowtow
@landon9720 it doesn't matter where you put the file in as long as you provide the correct value for href or in other words provide it the correct file path.Parlin
P
3

The descriptor document can be hosted just about anywhere, as long as its available to the browser on the client machine.

As Micah pointed out, in the web page you want to "advertise" your search capability, simply add a reference to the OSDD in your HTML HEAD:

<html>
  <head>
    ...
    <link rel="search" type="application/opensearchdescription+xml" title="[display name]" href="[path to OSDD]" />
    ...
  </head>
  ...

What this does is have browsers highlight the search area (e.g., in Firefox, blue glow, in MSIE, the button is highlighted orange, in Chrome, I believe the browser just adds the search provider without asking you) to let an end user know that this site has search capability that the browser can integrate with.

You can create your OSDD file here http://customsearchprovider.appspot.com (though it's really quite simple).

Incidentally, BugMeNot.com, Craigslist etc does not automatically add search providers to your browser (it hasn't done it for me after I've visited it several times). I suspect it must have been added manually, or perhaps imported from another browser when you first installed Chrome.

Perrine answered 23/12, 2009 at 13:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.