Skip to content

Instantly share code, notes, and snippets.

@trumad
Last active November 11, 2024 17:57
Show Gist options
  • Save trumad/368ed72d1d1e87a22569c2ac815ae0bf to your computer and use it in GitHub Desktop.
Save trumad/368ed72d1d1e87a22569c2ac815ae0bf to your computer and use it in GitHub Desktop.
Import Arc history in Firefox

No good reason why this had to be so tricky:

  • Install Export Chrome History extension in Arc
  • Export history to JSON. Choosing the forever option does actually export ALL the history in Arc
  • Install History Export for firefox
  • Optional: Export Firefox history, to see what the json looks like
  • Make the Arc history match what firefox expects. I used this javascript to convert it:
arcHistory.map(item => {
    return {
        id: item.id,
        url: item.url,
        title: item.title,
        lastVisitTime: Math.floor(item.lastVisitTime),
        visitCount: item.visitCount,
    }
})
  • Not much conversion required, but still, I didn't want firefox to crash because there was extra data, or floating point timestamps
  • Import the resulting json file using History Export
@Keyruu
Copy link

Keyruu commented Aug 13, 2024

It wouldn't work for me without converting the JSON. Here is a complete script for converting the history.json.

const fs = require('fs')

const history = fs.readFileSync('history.json')
const arcHistory = JSON.parse(history)
const data = arcHistory.map(item => {
    return {
        id: item.id,
        url: item.url,
        title: item.title,
        lastVisitTime: Math.floor(item.lastVisitTime),
        visitCount: item.visitCount,
    }
})

fs.writeFileSync('ff-history.json', JSON.stringify(data))

@trumad
Copy link
Author

trumad commented Aug 14, 2024

Thanks!

@evanrdlc
Copy link

It wouldn't work for me without converting the JSON. Here is a complete script for converting the history.json.

const fs = require('fs')

const history = fs.readFileSync('history.json')
const arcHistory = JSON.parse(history)
const data = arcHistory.map(item => {
    return {
        id: item.id,
        url: item.url,
        title: item.title,
        lastVisitTime: Math.floor(item.lastVisitTime),
        visitCount: item.visitCount,
    }
})

fs.writeFileSync('ff-history.json', JSON.stringify(data))

Confirmed working. Thank you.

@admbtlr
Copy link

admbtlr commented Nov 11, 2024

Thanks for this. I just did a regex search and replace to get rid of the decimal points in the visitTime and lastVisitTime values of the original file, which also worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment