Mozilla Open-Source Contributor Fixes a 5-Year-Old Bug Where Amazon Refused to Leave Firefox Top Sites
A deep dive into how a persistent bug on the Firefox New Tab page was successfully investigated and resolved after five years.

Stock photo for illustration only, not from the actual event
- Fixing a 5-year-old Firefox bug as part of the DEV's Summer Bug Smash challenge
- The root cause involved URLs being silently swapped to search-shortcuts, breaking deletion
- Mozilla engineers mak and thecount provided crucial code reviews and guidance
- The solution relies on storing the original URL reference as original_url before execution
This article is a submission for DEV's Summer Bug Smash powered by Sentry, where an open-source contributor at Mozilla shares the journey of hunting down and resolving a stubborn bug that haunted the Firefox web browser for half a decade. The bug report on Bugzilla was titled "Cannot remove amazon.com from top sites list," perfectly capturing the frustration experienced by users.
The user in the bug report complained about being unable to remove amazon.com from the Top Sites grid on the Firefox New Tab page. No matter how many times they right-clicked the Amazon tile and selected "Delete from History" or clicked "Dismiss," the tile stubbornly stayed put. To understand this, we look at Top Sites (the grid of website shortcuts), the New Tab page, and Places (the SQLite database Firefox uses for browsing history).
Before a tile reaches the New Tab page, Firefox checks each link against built-in search-shortcut sites like Google, Amazon, Bing, DuckDuckGo, eBay, Twitter, and Wikipedia. If a match occurs, Firefox swaps the tile's URL to trigger a search on that platform rather than visiting the actual homepage browsed by the user. This background substitution causes the URL to diverge from the original Places database entry.
Modern browser architecture often balances user history, sponsored content (spocs), and search-shortcuts, creating subtle architectural blind spots. In Firefox's case, mutating URLs behind the scenes without preserving the original destination reference means that delete requests from the frontend cannot locate the corresponding records in the backend database, leading to dead interactions.
The author's first attempt involved blocking the URL entirely whenever a user clicked "Delete History" so it would never return. However, Mozilla engineer mak pushed back, pointing out that silently blocking a site without explicit notice creates unexpected behavior and strips control away from the user rather than empowering them.
A second piece of feedback came from another Mozilla engineer, thecount, who pointed the author toward logging link.url and searchProvider.url right before line 1093 in NewTabUtils.sys.mjs. Upon startup, the logs revealed a mismatch between "https://www.amazon.com/" and "https://amazon.com", explaining why the URL was no longer removable.
Applying principles from full-stack MVC architecture, the ultimate fix ensures the reference to the URL is preserved before Firefox swaps it out:
- Store the original reference:
link.original_url = link.url; - Check for the presence of
original_urlduring deletion requests - Ensure backend handlers (PlacesFeed.sys.mjs) receive the correct identifier to purge records from SQLite
Source: Dev.to
Found something wrong in this article? Report an issue with this article
Comments
Leave a Comment