Skip to content

Instantly share code, notes, and snippets.

@mkg20001
Last active July 6, 2021 06:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mkg20001/195c0c1be2aeff08cce684bee8f89bd3 to your computer and use it in GitHub Desktop.
Save mkg20001/195c0c1be2aeff08cce684bee8f89bd3 to your computer and use it in GitHub Desktop.
Export all Domains from Chrome Browser History
'use strict'
// go to https://takeout.google.com/settings/takeout
// Create new export
// Select chrome
// Download the export
// Extract it and run this script in the folder (you can directly run from node REPL)
const history = require('./Takeout/Chrome/BrowserHistory.json')
const seen = {}
const domains = history['Browser History'].map(entry => (new URL(entry.url)).hostname).filter(domain => seen[domain] ? false : (seen[domain] = true))
const fs = require('fs')
fs.writeFileSync('domains.txt', domains.join('\n') + '\n')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment