Last active
July 6, 2021 06:43
-
-
Save mkg20001/195c0c1be2aeff08cce684bee8f89bd3 to your computer and use it in GitHub Desktop.
Export all Domains from Chrome Browser History
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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