Skip to content

Instantly share code, notes, and snippets.

@trumad
Last active May 29, 2025 16:10
Show Gist options
  • Select an option

  • Save trumad/368ed72d1d1e87a22569c2ac815ae0bf to your computer and use it in GitHub Desktop.

Select an option

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
Copy Markdown

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
Copy Markdown
Author

trumad commented Aug 14, 2024

Thanks!

Copy link
Copy Markdown

ghost commented Oct 22, 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))

Confirmed working. Thank you.

@admbtlr
Copy link
Copy Markdown

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.

@spirosbax
Copy link
Copy Markdown

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))

Works on Firefox 139.0 (aarch64)!

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