Hacker News new | past | comments | ask | show | jobs | submit login

So how would you code this feature so it works with any search engine off the bat and how would the team know this might be a priority to develop next if you haven’t filed a radar?



Use the OpenSearch specification [0]. Most search engines and even websites support it. It’s how, for example, you can search YouTube directly in the FF address bar.

[0] https://developer.mozilla.org/en-US/docs/Web/OpenSearch


Exactly the kind of thing I was looking for, thanks


OpenSearch is a bit of a confusing mess, because it describes both search descriptions for a site as well as for a site to ask to be a global search engine (aka OpenSearch plugins)

Interestingly, Safari at least used to support the first - if you type something into the bar on a site which advertises opensearch, those results will be incorporated into the displayed list.

For the global behavior, the guidance seems to have shifted from opensearch plugins to web extensions. Safari does not seem to support any of the search engine metadata fields currently.


I'd implement an existing widely supported standard: https://developer.mozilla.org/en-US/docs/Web/OpenSearch


Yeah this kind of thing is very interesting, it does look like safari supports it.


This feature has been solved on other browser.


I’m more interested in my actual question. If there is some sort of interoperable API or something, not engaging with hostile glib one liners.


A workaround approach - disregarding any existing standards - would be to simply give the user a random, unique string to search for and then try to detect that string in the URL (typically as a query parameter) - then the browser just has to replace that string with the user's actual search query in subsequent searches.


This is probably how Firefox works, because I get suggested a new search engine every time I search on a new site.



Here's a few options at different places in the spectrum for ease of UX vs. work required by the search engine:

Make search engines (appearing in that list) installable as apps.

Have search engine websites include some metadata about the API. When this metadata block is present, add a "make this site the default search engine" to the Safari menu.

Allow the user to enter an arbitrary URL with some substitutions.


The approach seems to be shifting from #2 (which winds up being an invasive prompt in some cases which is separate from management) to #1 in the form of Web Extensions.

Safari however does not currently support new search engines via web extension metadata.


Thanks good suggestions. I think both your last options would work. Either one could be passed through automatically with a deep link from their website (either the search engine base url or your special url in the last point)


Apple used to offer this but took it away years ago.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: