We pump the address bar of the browser

For some time now, the address bar not only displays the address of the current page, but also allows you to open a search page in different search engines. But not all sites have added OpenSearch so that you can easily add internal site search.



In the first part I will tell you how to add site search and other services yourself. And in the second part I will tell you what service, besides searching using OpenSearch hints, can organize a website.



OpenSearch is a set of technologies that enable websites and search engines to publish search results in formats that are easy to disseminate and collect.


We pump the address bar using the% s key



The key %sin the URL is replaced by the browsers FireFox and Chrome with the entered phrase after the short name of the URL of the bookmark or search engine, respectively.



Firefox



Firefox allows this key to be used in the bookmark URL. This key in the URL will be replaced with the phrase entered after the short name of the bookmark.



Add manually



To manually add a bookmark, open all bookmarks (Ctrl + Shift + B). Press the control button and the "New bookmark ..." item. In this case, all fields of the properties of the bookmark will be immediately available, but you will have to fill them in manually.



We add automatically



%s( ) . title. .



. .



Chrome



Chrome URL %s [ (chrome://settings/searchEngines).



Wayback Machine



: Wayback Machine

: "https://web.archive.org/web/%s"

: "-"

: "- https://example.com"



Wayback Machine HTTPS. '- ' . Wayback Machine .







:

: "https://habr.com/search/?q=%s"

: "-"

: "- "



. .



:

: "https://habr.com/p/%s"

: "-p"

: "-p 489638"



. . .



:

: "https://habr.com/ru/users/%s"

: "-u"

: "-u ivan386"



. 4 "-u ivan386". .





. %s URI +.



OpenSearch



OpenSearch . URL . .



OpenSearch . .



Firefox



Firefox OpenSearch @ . FireFox OpenSearch . .



OpenSearch . . .





. @ . .



:



  1. " "
  2. (about:preferences#search) " "
  3. " (ru)"
  4. " "
  5. : @wiki


:



  1. @
  2. @wiki .
  3. Open .
  4. OpenSearch Enter .


OpenSearch



.



:



  1. opensearch-demo
  2. " "
  3. (about:preferences#search) " "
  4. ""
  5. " "
  6. : @demo


:



  1. @
  2. @demo .
  3. - .
  4. .
  5. Enter Esc .




OpenSearch <head> :



<link rel="search"
        href="https://example.com/opensearchdescription.xml"
        type="application/opensearchdescription+xml"
        title="Search" />


opensearchdescription.xml:



<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">

  <!--   -->
  <ShortName>Search</ShortName>

  <!--       (  ) -->
  <Image type="image/png">https://example.com/websearch.png</Image>

  <!--  URL   -->
  <!-- Firefox   Url   "text/html" -->
  <Url  method="get" type="text/html"
       template="https://example.com/?q={searchTerms}"/>

  <!--  URL  (  ) -->
  <Url  method="get" type="application/x-suggestions+json" 
     rel="suggestions"
     template="https://example.com/suggest?q={searchTerms}" />

</OpenSearchDescription>


URL {searchTerms} . '+' URI .



URL JSON :



["{searchTerms}",[
" ",
" "
]]


{searchTerms} .



:

: "@wiki XML Encryption"

JSON:



["XML Encryption", ["XML Encryption"]]


OpenSearch



.





, .



:



: @habr





  1. : @habr -

    :



    
    
    


    . . ( ) Enter.





  2. : @habr

    :



      XML 
    XML    
       —    IPFS   XSLT
     16GB     4GB  


    . 9 . .





  3. : @habr

    :



             
               
         " "  $1000000


    .





  4. : @habr

    :



        


    . FireFox OpenSearch. URL .





Enter. Esc .





. .



OpenSearch .



Links



OpenSearch specification on GitHub

OpenSearch reference on MDN




All Articles