Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jclin10

macrumors regular
Original poster
Jul 1, 2009
147
17
I've found a lot of unfamiliar Youtube links in my Safari browsing history. Is it possible that it was hacked somehow?

Is there any way to see a timestamp for when links were accessed or locations from which they were accessed, assuming its even possible to hack it to begin with?
 

DarkPremiumCho

macrumors 6502
Mar 2, 2023
276
177
Maybe they are the result of some pop up ads.

Copy ~/Library/Safari/History.db to your Downloads folder and you can open it using sqlite3. The history items do have some relations to timestamps but I can't decipher them. They are not stored in a human-readable format.
 

gilby101

macrumors 68030
Mar 17, 2010
2,921
1,616
Tasmania
This was my StackExchange answer https://apple.stackexchange.com/que...sites-accessed-in-safari-on-mac/449046#449046

Safari's history (all the history) is in the database ~/Library/Safari/history.db.

For safety, duplicate this database, so you have ~/Library/Safari/history copy.db.

To explore the database I use SQLPro for SQLite which you can get from the Mac App Store. Use this or any similar app.

Open the database with SQLPro for SQLite.

The first thing you should see (in the left hand pane) is a list of the tables in the database.

enter image description here

Now select Query from the tool bar and enter this query:

Code:
select datetime(v.visit_time + 978307200, 'unixepoch', 'localtime') as date, i.domain_expansion, i.url
from history_items i left join history_visits v on i.id = v.history_item
order by i.id desc
limit 100;

This will combine data from two tables to give you a list of the most recent 100 of your history. The only tricky bit is the conversion of the date to make it readable.

After entering the query and clicking on the green arrow (Execute Query) you should get results in the lower pane similar to those in the screenshot.

When you are happy with the result, increase the limit to show more (or all) of your history - it may well be 100,000 of more.

Use the 'rectangle with arrow' at top left of results choosing 'Export export results set as' and 'CSV...'. Save the file which can then be used in Excel, Numbers (rather slow) or a text editor.

Disclaimer: The query was modified from one I found on the web.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.