
<div class="card col-sm-12 m-2 p-0 border border-info mx-auto">
<div class="card-body">
<p class="card-text m-0">This is an incomplete doc about browser site search shortcuts. You can modify your web browser so that after jumping to your address bar / 'omnibox' (<kbd>Cmd+L</kbd>) you can type a shortcut to search via a particular search tool.</p>
</div>
</div>

To add a search tool in your browser, you need a name for the tool, a shortcut, and a URL with %s in place of the query. [Here is the Google Chrome Help page](https://support.google.com/chrome/answer/95426?hl=en&co=GENIE.Platform%3DDesktop). You can reach the settings directly by typing the following into your address bar: `chrome://settings/searchEngines` <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-copy" onclick="copyToClipboard('chrome://settings/searchEngines')" viewBox="0 0 16 16" data-bs-toggle="tooltip" data-bs-placement="top" title="Click to copy">
  <path fill-rule="evenodd" d="M4 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm2-1a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1zM2 5a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-1h1v1a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h1v1z"/>
</svg>
<span id="copied-text" class="text-muted"></span>

<script>
function copyToClipboard(text) {
  const el = document.createElement('textarea');
  el.value = text;
  document.body.appendChild(el);
  el.select();
  document.execCommand('copy');
  document.body.removeChild(el);
  
  const copiedText = document.getElementById('copied-text');
  copiedText.innerHTML = 'Copied!';
  copiedText.style.display = 'inline';
  setTimeout(function() {
    copiedText.style.display = 'none';
  }, 2000);
}
</script>

<div class="card col-sm-12 m-2 p-0 border mx-auto">
<div class="card-body">
<div class="h5 card-title">Here is an example setup</div>
<p class="card-text m-0">Search: `danielsgriffin.com/search`</p>
<p class="card-text">Shortcut: `dsg`</p>
<p class="card-text">URL with %s in place of query: `https://danielsgriffin.com/search/?q=%s`</p>
</p>
</div>
</div>

<!-- // start liquid to draw from danielsgriffin/_data/browser_site_search_shortcuts.yml -->

{% assign search_tools = site.data.browser_site_search_shortcuts %}

<table class="table table-hover border table-sm">
  <caption class="mt-0 pt-0">Here is the search syntax for several search tools.</caption>
  <thead>
    <tr>
      <th scope="col">Search tool</th>
      <th scope="col">URL</th>
      <th scope="col">Shortcut</th>
    </tr>
  </thead>
  <tbody>
    {% assign sorted_tools = search_tools | sort: 'name' %}
    {% for tool in sorted_tools %}
      <tr>
        <td><a href="{{ tool.url }}">{{ tool.name }}</a></td>
        <td>{{ tool.search_url }}</td>
        <td>{{ tool.shortcut }}</td>
      </tr>
    {% endfor %}
  </tbody>
</table>

<!-- // end liquid to draw from danielsgriffin/_data/browser_site_search_shortcuts.yml -->

<div class="card col-sm-12 m-2 p-0 mx-auto">
<div class="card-body p-1 m-2">  
<div class="card col-sm-10 p-0 m-2 border mx-auto component-comment-note">
<div class="card-body p-1 m-0">
<p class="p-0 m-0"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="p-0 m-0 bi bi-sticky" viewBox="0 0 16 16">
<path d="M2.5 1A1.5 1.5 0 0 0 1 2.5v11A1.5 1.5 0 0 0 2.5 15h6.086a1.5 1.5 0 0 0 1.06-.44l4.915-4.914A1.5 1.5 0 0 0 15 8.586V2.5A1.5 1.5 0 0 0 13.5 1zM2 2.5a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 .5.5V8H9.5A1.5 1.5 0 0 0 8 9.5V14H2.5a.5.5 0 0 1-.5-.5zm7 11.293V9.5a.5.5 0 0 1 .5-.5h4.293z"/>
</svg></p>
<p class="p-1 m-1">
I made a goofy unofficial and unpacked Chrome extension to select a random search engine (with a provided shortcut), available on GitHub: [github.com/danielsgriffin/qrs](https://github.com/danielsgriffin/qrs).<sup><a class="pb-2" href="https://twitter.com/danielsgriffin/status/1476639963798114304"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" class="bi bi-twitter" viewBox="0 0 16 16">
  <path d="M5.026 15c6.038 0 9.341-5.003 9.341-9.334 0-.14 0-.282-.006-.422A6.685 6.685 0 0 0 16 3.542a6.658 6.658 0 0 1-1.889.518 3.301 3.301 0 0 0 1.447-1.817 6.533 6.533 0 0 1-2.087.793A3.286 3.286 0 0 0 7.875 6.03a9.325 9.325 0 0 1-6.767-3.429 3.289 3.289 0 0 0 1.018 4.382A3.323 3.323 0 0 1 .64 6.575v.045a3.288 3.288 0 0 0 2.632 3.218 3.203 3.203 0 0 1-.865.115 3.23 3.23 0 0 1-.614-.057 3.283 3.283 0 0 0 3.067 2.277A6.588 6.588 0 0 1 .78 13.58a6.32 6.32 0 0 1-.78-.045A9.344 9.344 0 0 0 5.026 15z"/>
</svg></a></sup>
</p></div></div>


<hr>
<p class="m-0 p-0 text-muted small">Added {{ "2023-08-29" | date: "%B %d, %Y" }}</p>
<p class="m-0 p-0">See also [the OpenSearch protocol description specs @ github.com/dewitt/opensearch](https://github.com/dewitt/opensearch), [an OpenSearch description format reference in the MDN docs][2], and [background on OpenSearch at Wikipedia][3].</p>

[2]: https://developer.mozilla.org/en-US/docs/Web/OpenSearch
[3]: https://en.wikipedia.org/wiki/OpenSearch

<div class="card col-sm-10 p-0 m-2 border mx-auto component-comment-note">
<div class="card-body p-1 m-0">
<p class="p-0 m-0"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="p-0 m-0 bi bi-sticky" viewBox="0 0 16 16">
<path d="M2.5 1A1.5 1.5 0 0 0 1 2.5v11A1.5 1.5 0 0 0 2.5 15h6.086a1.5 1.5 0 0 0 1.06-.44l4.915-4.914A1.5 1.5 0 0 0 15 8.586V2.5A1.5 1.5 0 0 0 13.5 1zM2 2.5a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 .5.5V8H9.5A1.5 1.5 0 0 0 8 9.5V14H2.5a.5.5 0 0 1-.5-.5zm7 11.293V9.5a.5.5 0 0 1 .5-.5h4.293z"/>
</svg></p>
<p class="p-1 m-1">[This is my first time suggesting an edit to a Stack Overflow answer](https://twitter.com/danielsgriffin/status/1696642364805390492).
</p>

<span class="text-muted">HT: [https://stackoverflow.com/questions/6746256/how-do-i-instruct-the-googles-omnibar-the-way-to-do-a-search-for-my-domain/6746304#6746304](https://stackoverflow.com/questions/6746256/how-do-i-instruct-the-googles-omnibar-the-way-to-do-a-search-for-my-domain/6746304#6746304)</span>

</div></div>

<hr>
<p class="m-0 p-0 text-muted small">Added {{ "2023-08-29" | date: "%B %d, %Y" }}</p>
<p class="m-0 p-0">While searching to try to remember the name of the OpenSearch protocol, g[parameter q in searches browsers sites engines], I stumbled on [Sourcegraph's Browser search engine shortcuts](https://docs.sourcegraph.com/integration/browser_extension/how-tos/browser_search_engine) doc.</p>

> You can add Sourcegraph as a browser search engine to quickly search Sourcegraph from your browser's location bar when you type a special shortcut, such as <kbd>src</kbd>. This is one of the most common ways to initiate a search on Sourcegraph.

<p class="m-0 p-0">As an example, you can search: [https://sourcegraph.com/search?q=OpenSearchDescription](https://sourcegraph.com/search?q=OpenSearchDescription)</p>
<hr>
<p class="m-0 p-0 text-muted small">Added {{ "2023-08-29" | date: "%B %d, %Y" }}</p>
<p class="m-0 p-0">Added Sourcegraph to the table.</p>
<hr>
<p class="m-0 p-0 text-muted small">Added {{ "2023-12-01 14:30:48 -0800" | date: "%B %d, %Y %I:%M %p (%Z)" }}</p><p class="m-0 p-0">
- I've added Marginalia Search to the table above.
- I've added the actual shortcuts I use in my browser to the table.
- TODO: Look into supporting programmatically updating browser site search shortcuts with a Chrome extension.
- Added 'omnibox' tag.
</p>



</div>
</div>