<?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>Florian Helmberger's blog &#187; remove</title>
	<atom:link href="http://www.laudatio.com/wordpress/tag/remove/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.laudatio.com/wordpress</link>
	<description>laudatio.com</description>
	<lastBuildDate>Wed, 15 Jun 2011 17:13:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>How to remove entries from Firefox Smartbar</title>
		<link>http://www.laudatio.com/wordpress/2009/11/23/how-to-remove-entries-from-firefox-smartbar/</link>
		<comments>http://www.laudatio.com/wordpress/2009/11/23/how-to-remove-entries-from-firefox-smartbar/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 20:51:35 +0000</pubDate>
		<dc:creator>fh</dc:creator>
				<category><![CDATA[Diverses]]></category>
		<category><![CDATA[awesomebar]]></category>
		<category><![CDATA[delete]]></category>
		<category><![CDATA[entries]]></category>
		<category><![CDATA[entry]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[moz_places]]></category>
		<category><![CDATA[places.sqlite]]></category>
		<category><![CDATA[remove]]></category>
		<category><![CDATA[smartbar]]></category>
		<category><![CDATA[sqlite]]></category>

		<guid isPermaLink="false">http://www.laudatio.com/wordpress/?p=126</guid>
		<description><![CDATA[I really got to love the Smartbar aka Awesomebar, introduced in Firefox 3. But in some way it annoyed me that there is no really obvious way to remove entries from it. Sure, after a bit of research via Google I found out, that you can press shift+delete while hovering with your mouse over an [...]]]></description>
			<content:encoded><![CDATA[<p>I really got to love the Smartbar aka Awesomebar, introduced in Firefox 3. But in some way it annoyed me that there is no really obvious way to remove entries from it. Sure, after a bit of research via Google I found out, that you can press shift+delete while hovering with your mouse over an entry. But this doesn't help much if you want to get rid of all entries for a given domain or containing a specific keyword - so this may get kind of tedious. It also seems, that there isn't even a single Add-on which can deal with this. If I missed something, please drop me a quick note.</p>
<p>Nevertheless, being a part-time hacker I also couldn't overlook, that Firefox is saving lots of the data it stores on your workstation in SQLite databases. And where is SQL, there is rescue!</p>
<p>So, first step - where are those database files? On Mac OS X, they are usually located in</p>
<pre>~/Library/Application\ Support/Firefox/Profiles/&lt;some string&gt;.default/</pre>
<p>The one you want to hassle with is named</p>
<pre>places.sqlite</pre>
<p>Note, from now on you have to work while Firefox isn't running. Otherwise, the SQLite database is locked and you can't access it. But let's get to business - we're interested in the following table:</p>
<pre class="bash">fh$ sqlite3 places.sqlite
SQLite version <span style="color: #000000;">3.4</span><span style="color: #000000;">.0</span>
Enter <span style="color: #ff0000;">&quot;.help&quot;</span> <span style="color: #000000; font-weight: bold;">for</span> instructions
sqlite&gt; .schema moz_places
CREATE TABLE moz_places <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">id</span> INTEGER PRIMARY KEY, url LONGVARCHAR, \
  title LONGVARCHAR, rev_host LONGVARCHAR, visit_count INTEGER DEFAULT <span style="color: #000000;">0</span>, \
  hidden INTEGER DEFAULT <span style="color: #000000;">0</span> NOT NULL, typed INTEGER DEFAULT <span style="color: #000000;">0</span> NOT NULL, \
  favicon_id INTEGER, frecency INTEGER DEFAULT <span style="color: #000000;">-1</span> NOT NULL, \
  last_visit_date INTEGER<span style="color: #7a0874; font-weight: bold;">&#41;</span>;
CREATE INDEX moz_places_faviconindex ON moz_places <span style="color: #7a0874; font-weight: bold;">&#40;</span>favicon_id<span style="color: #7a0874; font-weight: bold;">&#41;</span>;
CREATE INDEX moz_places_frecencyindex ON moz_places <span style="color: #7a0874; font-weight: bold;">&#40;</span>frecency<span style="color: #7a0874; font-weight: bold;">&#41;</span>;
CREATE INDEX moz_places_hostindex ON moz_places <span style="color: #7a0874; font-weight: bold;">&#40;</span>rev_host<span style="color: #7a0874; font-weight: bold;">&#41;</span>;
CREATE INDEX moz_places_lastvisitdateindex ON moz_places <span style="color: #7a0874; font-weight: bold;">&#40;</span>last_visit_date<span style="color: #7a0874; font-weight: bold;">&#41;</span>;
CREATE UNIQUE INDEX moz_places_url_uniqueindex ON moz_places <span style="color: #7a0874; font-weight: bold;">&#40;</span>url<span style="color: #7a0874; font-weight: bold;">&#41;</span>;
CREATE INDEX moz_places_visitcount ON moz_places <span style="color: #7a0874; font-weight: bold;">&#40;</span>visit_count<span style="color: #7a0874; font-weight: bold;">&#41;</span>;
sqlite&gt;</pre>
<p>The url column holds the complete URL Firefox shows in the Smartbar, so we can simply write a quick query:</p>
<pre class="sql">sqlite&gt; <span style="color: #993333; font-weight: bold;">SELECT</span> url <span style="color: #993333; font-weight: bold;">FROM</span> moz_places <span style="color: #993333; font-weight: bold;">WHERE</span> url <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">'%bbc.co.uk%'</span>;
&nbsp;
http://news.bbc.co.uk/go/rss/-/<span style="color: #cc66cc;">2</span>/hi/middle_east/<span style="color: #cc66cc;">8372985</span>.stm
&nbsp;
http://news.bbc.co.uk/go/rss/-/<span style="color: #cc66cc;">2</span>/hi/asia-pacific/<span style="color: #cc66cc;">8372795</span>.stm</pre>
<p>If I wanted to get rid of them this query would do:</p>
<pre class="sql"><span style="color: #993333; font-weight: bold;">DELETE</span> <span style="color: #993333; font-weight: bold;">FROM</span> moz_places <span style="color: #993333; font-weight: bold;">WHERE</span> url <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">'%bbc.co.uk%'</span>;</pre>
<p>Replace the domain accordingly, backup your places.sqlite before changing anything and you're good.</p>
<p>The location of places.sqlite on other OS:</p>
<p><strong>Windows XP</strong></p>
<pre>C:\Documents and Settings\&lt;username&gt;\Application Data\Mozilla\Firefox\
  Profiles\&lt;profile folder&gt;\places.sqlite</pre>
<p><strong>Windows Vista</strong></p>
<pre>C:\Users\&lt;user&gt;\AppData\Roaming\Mozilla\Firefox\Profiles\
  &lt;profile folder&gt;\places.sqlite</pre>
<p><strong>GNU/Linux</strong></p>
<pre>/home/&lt;user&gt;/.mozilla/firefox/&lt;profile folder&gt;/places.sqlite</pre>
<p>If you're on an OS which doesn't ship with any SQLite interface, go to the SQLite <a href="http://www.sqlite.org/">website</a> and download it. Or, if that is to much hassle for you, there is a Firefox Add-on, called <a href="https://addons.mozilla.org/en-US/firefox/addon/5817">SQLite Manager</a>, which can access and change SQLite databases too. But remember: you have to work on a copy of places.sqlite as the file is locked while Firefox itself is running.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.laudatio.com/wordpress/2009/11/23/how-to-remove-entries-from-firefox-smartbar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

