<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>nothing to see here &#187; Web</title>
	<atom:link href="http://www.endolith.com/wordpress/category/web/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.endolith.com/wordpress</link>
	<description>move along</description>
	<lastBuildDate>Sat, 03 Dec 2011 22:20:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Quick Search Bookmarklets</title>
		<link>http://www.endolith.com/wordpress/2007/02/10/quick-search-bookmarklets/</link>
		<comments>http://www.endolith.com/wordpress/2007/02/10/quick-search-bookmarklets/#comments</comments>
		<pubDate>Sat, 10 Feb 2007 07:50:57 +0000</pubDate>
		<dc:creator>Endolith</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[bookmarklet]]></category>
		<category><![CDATA[Firefox]]></category>

		<guid isPermaLink="false">http://endolith.com/wordpress/2007/02/10/quick-search-bookmarklets/</guid>
		<description><![CDATA[Update: I do all this with Ubiquity now. Quick Search: A feature of Mozilla browsers that allows you to store a bookmark with a variable and a keyword, to allow custom searches by typing the keyword and a search term into the location bar Bookmarklets: Bookmarks that, instead of a normal URL, contain small javascript [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update: I do all this with <a href="http://labs.mozilla.com/projects/ubiquity/">Ubiquity</a> now.</strong></p>
<hr />
<ul>
<li><a title="Mozilla Custom Keywords ROCK! Not just for making shorthand for bookmarks but also for searches and queries..." href="http://www.mozilla.org/docs/end-user/keywords.html">Quick Search</a>: A feature of Mozilla browsers that allows you to store a bookmark with a variable and a keyword, to allow custom searches by typing the keyword and a search term into the location bar</li>
<li> <a title="A bookmarklet is a small JavaScript program that can be stored as a URL within a bookmark..." href="http://en.wikipedia.org/wiki/Bookmarklet">Bookmarklets</a>: Bookmarks that, instead of a normal URL, contain small javascript programs</li>
</ul>
<p>What could be better than these?  Combine them together!</p>
<p>In November 2005, I was trying to get rid of the <a title="What is the Googlebar? The Googlebar project was initially created to address the widespread desire in the mozilla community for the Google toolbar to support the Netscape 7, Mozilla, and Firefox web browsers..." href="http://googlebar.mozdev.org/">Googlebar extension</a>, since I didn&#8217;t use most of its features, and the parts that I actually used could be better met by more specialized, less Google-oriented extensions.  For instance, the <a title="SearchWP is an extension that help you to find words typed in the searchbar in the current page. SearchBox Sync automatically updates the searchbox content when you search directly in a search engine (Google, Yahoo, ...)." href="http://legege.com/en/mozilla/">SearchBox Sync and SearchWP extensions</a> have the same functionality as Googlebar&#8217;s terms toolbar, but use Firefox&#8217;s native search box and sync with any search engine; not just Google.  Google&#8217;s translation service could be better met by a dedicated translation extension, like <a title="translator is web translation extension that allows you to translate any web page into nearly any language at the click of a button." href="https://addons.mozilla.org/firefox/3361/">translator</a>, or <a title="Small extension that either translates: web pages (via toolbar button) or selected text (via context menu) from several foreign languages into English, as well as 12 other languages." href="https://addons.mozilla.org/firefox/181/">Translate</a>, the Google cache feature could be replaced by a dedicated cache-viewing extension like any of these: <a title="Resurrect" href="http://firefox-extensions.arantius.com/resurrect">1</a> <a title="Cache View" href="https://addons.mozilla.org/firefox/2323/">2</a> <a title="CacheIt!" href="https://addons.mozilla.org/firefox/1700/">3</a> <a title="404cache" href="https://addons.mozilla.org/firefox/1732/">4</a> <a title="Passive Cache" href="https://addons.mozilla.org/firefox/977/">5</a> <a title="Archive Search Toolbar Button" href="https://addons.mozilla.org/firefox/551/">6</a> <a title="Methusalem" href="http://murli.34sp.com/o/methusalem/">7</a> <a title="ErrorZilla" href="http://roachfiend.com/archives/2006/08/28/errorzilla-useful-error-pages-for-firefox/">8</a></p>
<p>But what to do about Google&#8217;s site: search?  (It lets you search for a term within the domain you are currently viewing.)  I couldn&#8217;t find an extension to replace this functionality, but it&#8217;s a feature that I use regularly, so I couldn&#8217;t get rid of the Googlebar quite yet.  There&#8217;s no way to do this with a <a title="The Mycroft project provides a collection of Sherlock &amp; OpenSearch Search Engine Plugins (9978 at the last count) for your web browser." href="http://mycroft.mozdev.org/">Mycroft plugin</a>, as far as I know, since it needs to know the site you&#8217;re currently on, in addition to the search term.  Likewise, it couldn&#8217;t be done with a Quick Search, since the URL it generates only varies by search term; not the URL you are currently visiting.  It could be done with a bookmarklet, but the search term would have to be entered into a prompt: popup, highlighted on the page before clicking the bookmarklet, or the like.</p>
<p>So why not use the Quick Search functionality for the search term (<code>%s</code>), the bookmarklet to determine what site you&#8217;re on (location.hostname), and the keyword for the interface?  So I did.  After some work (and several revisions), I use this:</p>
<ul>
<li><a title="Type 'site &lt;search terms&gt;' in the location bar to perform a Google site: search." href="javascript:q = %22%22 + ('%s' != '%' + 's' ? '%s' : window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : document.selection.createRange().text); if (!q) q = prompt(%22You didn't select any text.  Enter a search phrase:%22, %22%22); if (q!=null) location=%22http://www.google.com/search?q=site:%22 + escape(location.hostname) + %22 %22 + escape(q.replace(/ /g, %22+%22)); void 0;">Google site: search Quick Search Bookmarklet</a></li>
</ul>
<p>If you drag it to your Bookmarks Toolbar and give it a keyword:</p>
<p><a rel="attachment wp-att-18" href="http://www.endolith.com/wordpress/2007/02/10/quick-search-bookmarklets/site-search/"><img class="alignnone size-medium wp-image-18" title="site: search bookmarklet" src="http://endolith.com/wordpress/wp-content/uploads/2007/12/screenshot.png" alt="Screenshot of bookmarklet properties" width="300" height="190" /></a></p>
<p>You can then search for a term anywhere within the domain you are currently viewing by doing one of the following things:</p>
<ul>
<li>Enter &#8220;site searchterm&#8221; into the Location bar</li>
<li>Highlight a search term on the page and click the &#8220;Site:&#8221; button in the Bookmarks Toolbar</li>
<li>Highlight a search term on the page and type &#8220;site&#8221; in the Location bar</li>
<li>Click &#8220;Site:&#8221; in the Bookmarks Toolbar and then type your search term in the prompt() window that pops up</li>
<li>Enter &#8220;site&#8221; in the Location bar and then type your search term in the prompt() window</li>
</ul>
<p>So many possibilities!</p>
<p>Also, when I first wrote it, I could highlight a word and then select Site: from the context menu using the <a title="SmartSearch for Firefox gives you access to your Smart Keywords from within the browser context menu. When text is selected in the browser you can search for the selection on any of the engines that you have configured with Bookmarks Smart Keywords." href="http://www.pitt.edu/%7Ecrp11/firefox/smartsearch/">SmartSearch extension</a>, which allowed me to leave the bookmarklet in my Quick Searches folder and still access it with the mouse without cluttering up my Bookmarks Toolbar.  I rarely used this, though, and it appears to have broken; I don&#8217;t know if one of my changes broke it or if a change to SmartSearch broke it.</p>
<p>Other search keywords I use:</p>
<ul>
<li><a title="Wikipedia WP:shortcuts" href="javascript:q = %22%22 + ('%s' != '%' + 's' ? '%s' : window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : document.selection.createRange().text); if (!q) q = prompt(%22You didn't select any text.  Enter a WP: shortcut:%22, %22%22); if (q!=null) location=%22http://en.wikipedia.org/wiki/WP:%22 + escape(q.replace(/ /g, %22+%22).toUpperCase()); void 0;">wp</a>: Goes to the shortcut that I typed on Wikipedia.  So if I type &#8220;wp wotta&#8221; it capitalizes it and goes to <a title="Wikipedia:WTF? OMG! TMD TLA. ARG!" href="http://en.wikipedia.org/wiki/Wikipedia:WTF%3F_OMG%21_TMD_TLA._ARG%21">WP:WOTTA</a></li>
<li><a title="Wayback search" href="javascript:void(location.href='http://web.archive.org/web/*/'+escape(location.href));">wayback</a>: Goes to the Wayback Machine listing for the page I am viewing (this isn&#8217;t actually a Quick Search, since it doesn&#8217;t involve any search terms, but I access it by typing &#8220;wayback&#8221; into the location bar, so I&#8217;m using a keyword and bookmarklet at the same time)</li>
<li><a title="Wayback newest" href="javascript:void(location.href='http://web.archive.org/'+escape(location.href));">latest</a>: Goes to the most recent archived copy on the Wayback Machine, like above</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.endolith.com/wordpress/2007/02/10/quick-search-bookmarklets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

