Skip to content

Instantly share code, notes, and snippets.

@claui
Created October 2, 2021 21:18
Show Gist options
  • Save claui/30a5ee2dc2c2389cd09d9595310823f0 to your computer and use it in GitHub Desktop.
Save claui/30a5ee2dc2c2389cd09d9595310823f0 to your computer and use it in GitHub Desktop.
OpenSearch descriptor for searching Twitter
<?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>Twitter (latest)</ShortName>
<Description>Twitter Search</Description>
<Url type="text/html" method="get" template="https://twitter.com/search">
<Param name="q" value="{searchTerms}"/>
<Param name="f" value="live"/>
</Url>
<Image width="16" height="16">https://abs.twimg.com/favicons/favicon.ico</Image>
<InputEncoding>UTF-8</InputEncoding>
<moz:SearchForm>https://twitter.com/search-home</moz:SearchForm>
</OpenSearchDescription>
@claui
Copy link
Author

claui commented Oct 2, 2021

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/30a5ee2dc2c2389cd09d9595310823f0'
    + '/raw/578e5a3b22889e069556ed8b00c991d7713400ce/opensearch-twitter.xml',
  null
)

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