Feature Proposal: Offer an OpenSearch plugin
Motivation
quick jump to known topics without having to load a wiki page first
Description and Documentation
OpenSearch is an XML format which may be referenced in a web page's header and causes the browser to offer to the user to include a new "search engine" to his/her list of search engines. OpenSearch been defined thirteen years ago and is support by all common browsers (IE, Firefox, Chrome, Safari).
See
https://en.wikipedia.org/wiki/OpenSearch and
https://developer.mozilla.org/en-US/docs/Web/OpenSearch for details.
What happens to the user: E.g. in Firefox, if a site offers a search plugin, there appears a little white "+" in a little green circle on the magnifying glass in the search field. The user may or may not react to this. The user may well choose to ignore that little hint completely. There no blinking annoyance or popup or whatsoever.
The XML code below offers a search plugin which in fact is a "jump plugin", which means: You enter something like
Main.JohnnyBGoode
into your browser's search field, select the Foswiki search engine and get the Wiki page
Main.JohnnyBGoode
immediately. No need to open some Wiki page first and enter the "jump" form there.
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/">
<os:ShortName>Foswiki</os:ShortName>
<os:Description>Foswiki</os:Description>
<os:InputEncoding>UTF-8</os:InputEncoding>
<os:OutputEncoding>UTF-8</os:OutputEncoding>
<os:Image width="16" height="16">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXZwQWcAAAAQAAAAEABcxq3DAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAABIAAAASABGyWs+AAAApklEQVQ4y2MIWs/wnxLMAGMErmP4H7KB5X/iNnE8WAy/AYV79f4TAqEbWHEbULBHF67wz99f/3+j4Z9/vhFvQMZORbCX0DFeLyAbkLpDlvRARDYgfacC0EZmFBwEVBNIjAH//v3DGYAgdUS54NuvT/+//voAx99/fwaHAdEGxG4R+O+xigEFo2umbSAOjAHISTlthxzpBoCiCaQxfYc8JN5JMYBcDAC/hGJm028s4wAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxOC0wMS0wOFQxMToxNjozMCswMTowMN3xkSoAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTctMDktMDdUMTQ6MzU6MjcrMDI6MDBCsWtGAAAAAElFTkSuQmCC</os:Image>
<os:Url type="text/html" method="GET" template="https://mylocalfoswiki.example.com/foswiki/Main/WebHome?topic={searchTerms}"></os:Url>
</SearchPlugin>
Code in HTML header:
<link rel='search' type='application/opensearchdescription+xml'
title='Foswiki' href='/browserpath/to/searchplugin_foswiki.xml' />
ShortName (up to 16 characters) and Description (up to 1024 characters) should be configurable.
/browserpath/to and icon (the example above uses Foswiki's standard icon in base64 encoding) can be derived automatically from Foswiki's local installation parameters.
Also, the mechanism above might be used to provide direct access to the search engine of a Foswiki installation.
Examples
Impact
Negative impact: One more HTML header line; one more file to load when a page is loaded.
Positive impact: User is free to add this favorite Foswiki to his/her list of search engines. Will not change the user's default search engine. Won't do anything if the user doesn't react to the offer.
Implementation
--
Contributors: ChristianKern - 05 Oct 2018
Discussion