

Removing Bad Autocompletes from Firefox's Location Bar (Shallow Thoughts)
source link: https://shallowsky.com/blog/tech/web/removing-firefox-suggestions.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Removing Bad Autocompletes from Firefox's Location Bar
A priest, a minister, and a rabbit walk into a bar.
The bartender asks the rabbit what he'll have to drink.
"How should I know?" says the rabbit. "I'm only here because of autocomplete."
Firefox folks like to call the location bar/URL bar the "awesomebar" because of the suggestions it makes. Sometimes, those suggestions are pretty great; there are a lot of sites I don't bother to bookmark because I know they will show up as the first suggestion.
Other times, the "awesomebar" not so awesome. It gets stuck on some site I never use, and there's seemingly no way to make Firefox forget that site.
![[Bogus firefox urlbar autocomplete]](http://shallowsky.com/blog/images/screenshots/wapo-places.jpg)
I haven't visited the Washington Post's feeds page in years (at least not intentionally, as opposed to accidentally going there because Firefox wants me to). I definitely don't have it bookmarked. For one thing, I mostly use RSS feeds from my RSS reader and seldom visit them in Firefox. Also, nothing against the Washington Post -- they publish some good stories -- but their RSS feeds aren't so hot. Their national news feed tends to be heavy on stories like "First she faced her fear of heights, then she took on something even scarier: Remarriage" (actual headline from today's WaPo national feed) and light on actual breaking news.
Firefox is so insistent on getting me to visit the WaPo RSS page that I have often wondered if maybe Mozilla was getting funding from the Washington Post -- but no, I tried a new profile and the WaPo URL didn't appear. So something in my profile was causing it. I have no bookmarks with "washington" in them. Where could it be coming from?
There are scads of discussions all over the web where people ask how to remove URL bar autocomplete entries. The replies always address a different question: how to remove entries from the dropdown menu below the urlbar. Supposedly, you highlight an entry in that menu and press Shift+Delete. I haven't found that to be terribly reliable -- sometimes it works, sometimes the item comes back. But in any case, the highlighted autocomplete that appears in the URL bar apparently comes from a completely different list, and Shift+Delete has no effect on it.
I've searched many times for hints on how to remove an unwanted autocomplete entry, with no success. I decided I needed to go to a lower level, find out where that URL was coming from in my profile, and delete it from my profile without Firefox's help.
The "Places" Database
Firefox profiles are normally in ~/.mozilla/firefox/randomstring.profilename, e.g. ~/.mozilla/firefox/asdf7a6g.default. If you look in your firefox profile, you'll see a file called places.sqlite. That's where Firefox stores your bookmarks and browsing history.
I knew that places.sqlite was often related to this sort of urlbar malfunction: many years ago I cured a similar problem by deleting places.sqlite entirely. But that removes all bookmarks, history, etc. I didn't know back then how easy it is to examine an sqlite file. This time, I wanted a more targeted fix.
You can examine the places database by typing
sqlite3 /tmp/places.sqlite
.
If you're planning to make changes, quit firefox first, and be sure
to make a backup copy of the file.
You can list all the tables in an sqlite database with .tables
:
sqlite> .tables moz_anno_attributes moz_annos moz_bookmarks moz_bookmarks_deleted moz_historyvisits moz_hosts moz_inputhistory moz_items_annos moz_keywords moz_meta moz_origins moz_places moz_places_metadata moz_places_metadata_groups_to_snapshots moz_places_metadata_search_queries moz_places_metadata_snapshots moz_places_metadata_snapshots_extra moz_places_metadata_snapshots_groups moz_session_metadata moz_session_to_places
According to this Mozilla support thread, the two important tables for things like urlbar completion are these:
moz_places => look in the URL column
moz_origins => look in the host column
Searching for Entries
To see if you have any places entries matching a particular pattern:
SELECT * FROM moz_places WHERE url LIKE '%feeds.washingtonpost%'; SELECT * FROM moz_origins WHERE host LIKE '%feeds.washingtonpost%';
Sure enough, I had several matches in both tables.
Deleting Entries
So you've found matches and you want to delete them.
Make a backup of places.sqlite in case you mess up, then run sqlite3:
cp places.sqlite places.sqlite.bak sqlite3 places.sqlite
Then inside sqlite3, run
DELETE from moz_places where url LIKE '%feeds.washingtonpost%'; DELETE from moz_origins where host LIKE '%feeds.washingtonpost%';
substituting the pattern you're trying to remove. SQL uses % rather than * as a wildcard character.
In my case, that removed the errant washingtonpost suggestion from
the list. Now, when I type feeds
, the URLbar contains
only what I type -- so if I hit return without arrowing down into
the suggestion menu, I get a search for feeds
in my chosen search engine.
I'm still a bit puzzled about what does control autocomplete entries. I did some more exploring in sqlite3, and it turned out that it was the single entry in moz_origins that controlled the errant autocomplete entry; I didn't actually need to delete the entries in moz_places. But I haven't yet figured out how to add an entry, in case I want an autocomplete when I type "feeds". I'll continue exploring, and will follow up with what I discover.
Tags: web, firefox, sql
[ 16:54 Nov 15, 2021
More tech/web |
permalink to this entry |
]
Recommend
-
12
Petition for Better Los Alamos Broadband Los Alamos (and White Rock) Alert! Los Alamos and White Rock readers: please direct your attent...
-
13
Removed RSS 0.9.1 feed; Calendar Working Better Fixing the Disqus comment system required reg...
-
18
Blog Comments should be working again The Disqus comments here have been broken for quite some time, and I didn't realize it. I just thought nobody must interested in...
-
18
MarsMap: What Features of Mars are Visible?
-
9
Y is for Yunque Dave was browsing through satellite imagery and noticed what looked like an old bridge across the Rio Grande just north of Española, near the Ohkay Owingeh p...
-
5
Hack to fix Firefox 90.0's new invisible menu Yesterday I started up my browser and discovered that I had no menu.
-
9
Firefox Broken on Local Domains I maintain quite a few domains, both domains I own and domains belonging to various nonprofits I belong to. For testing th...
-
9
Importing Cookies from a Firefox Profile in Python I wrote at length about my explorations into s...
-
5
View or Reset All Your Firefox Zoom Settings Firefox's zoom settings are useful. You can zoom in on a page with Ctrl-+ (actually Ctrl-+ on a US-English keybo...
-
5
Exploring your Search History in Firefox I wanted to find something I'd googled for recently. That should be eas...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK