While searching on well known and reliable pages, I suddenly had a new tab in firefox open with offending content.

I closed the page, but it is still visible in the history of firefox.

I want to know which site has opened this page.

Is there a way to get this information?

2 Answers 2


Yes, look in your history, what page were you on before it opened? It was probably that one, or one that had only recently loaded.


If you can't find it in the History itself, it is time for some detective work. Open up a terminal window and cd to your profile folder, something like ~/.mozilla/firefox/xxxxxx.default/. Open the places database:

sqlite3 places.sqlite

If you don't have sqlite3, simply install it. Note: sqlite3 is NOT the same as sqlite.
Now Firefox distinguishes web pages from visits to that page. First, we look up the id of the offending page.

select id, url from moz_places where url like "offending url here";

If you don't know the whole URL but a significant bit of it, put it like this:

select id, url from moz_places where url like "%part-that-you-do-know%";

This will give you a number, let's say xxx. Let's find the most recent visit to that page:

select * from moz_historyvisits where place_id = xxx;

The first number on the resulting line is the number of your visit; the second number, call that yyy, is the visit to the referring page. So do:

select * from moz_historyvisits where from_visit = yyy;

This will give you a similar line. This contains the id of the page that led you to the offending page. The third number on that line is that id. Call it zzz. Now find the URL from that visit:

select url from moz_places where id = zzz;

And that gives you your URL.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.