Skip to content

Instantly share code, notes, and snippets.

@claui
Created May 21, 2022 12:12
Show Gist options
  • Save claui/e90302d820ec8800f9603abd1da11d7f to your computer and use it in GitHub Desktop.
Save claui/e90302d820ec8800f9603abd1da11d7f to your computer and use it in GitHub Desktop.
OpenSearch descriptor for Python Enhancement Proposals (PEPs)
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<ShortName>PEP</ShortName>
<Description>Python Enhancement Proposal</Description>
<Url type="text/html" method="get" template="https://peps.python.org/pep-{searchTerms}/"></Url>
<Image width="200" height="200" type="image/png">https://upload.wikimedia.org/wikipedia/commons/thumb/c/c3/Python-logo-notext.svg/200px-Python-logo-notext.svg.png</Image>
<InputEncoding>UTF-8</InputEncoding>
<moz:SearchForm>https://peps.python.org/pep-0000/</moz:SearchForm>
</OpenSearchDescription>
@claui
Copy link
Author

claui commented May 21, 2022

To add this search extension to Firefox:

  1. Navigate to about:config.
  2. Set the devtools.chrome.enabled preference to true.
  3. Open Browser Console.
    Caution: that’s not the Developer Tools console. It’s something entirely different.
  4. Paste the following code snippet into the Browser Console:
await Services.search.addOpenSearchEngine(
  'https://gist.githubusercontent.com/claui/e90302d820ec8800f9603abd1da11d7f'
    + '/raw/927918e6bc036f1f5a057b1752e244403c5584b5/opensearch-pep.xml',
  null
)

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