Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save claui/50ba45a682fc2729c17ed9e84a899e26 to your computer and use it in GitHub Desktop.
Save claui/50ba45a682fc2729c17ed9e84a899e26 to your computer and use it in GitHub Desktop.
OpenSearch descriptor to search package source files in Arch Linux’s GitLab
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<ShortName>Arch Linux package source files</ShortName>
<Description>Search package source files in Arch Linux’s GitLab</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16" type="image/x-icon">https://gitlab.archlinux.org/favicon.ico</Image>
<Url type="text/html" method="get"
template="https://gitlab.archlinux.org/search">
<Param name="group_id" value="11323" /><!-- Packages -->
<Param name="scope" value="blobs" />
<Param name="search" value="{searchTerms}"/>
</Url>
<moz:SearchForm>https://gitlab.archlinux.org/search</moz:SearchForm>
</OpenSearchDescription>
@claui
Copy link
Author

claui commented Mar 5, 2024

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/50ba45a682fc2729c17ed9e84a899e26'
    + '/raw/2a1e05c953a895e5a8891dd0eab6bf8c83d8470d'
    + '/opensearch-archlinux-package-source-files.xml',
  null
)

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