Yomichan is a very cool pop-up dictionary for web browsers. However, it has been sunset. A promising fork exists in the form of Yomitan but migration is going to require people to be able to move their dictionaries (of which there could be numerous) and import them again. More importantly, Yomichan has always missed the migration story for when people want to move between devices or browsers because dictionaries had to be imported one at a time every time.
I have a temporary fork of Yomichan (named Yomibaba for kicks) that supports exporting and importing the entire IndexedDB database of dictionaries that have been imported by Yomichan. This lets you track only one file when you want to migrate between browsers and devices, or indeed when you just want to share your settings with newer people without giving them a mountain of drudgery to tackle first. Backups also become more manageable. It is also significantly faster to load all the data this way since it avoids all the parsing and validation that Yomichan typically does (of course that means the data could be invalid too).
The problem is that the existing Yomichan extension installations don’t have the code that lets you export the database. Which means that we have no choice but to inject and run the code on top of the extension somehow. This repository is just to provide a method that works without much headache for the end-user to that end.
- Open Yomichan’s setting page (click the gear icon from Yomichan’s popup)
- Open the web developer onsole
- Hit
F12
orCTRL + SHIFT + I
on Windows and Linux;CMD + OPT + I
on MacOS
- Hit
- Switch to the
console
tab - Paste the following into the console and wait for the export + download to finish:
fetch("https://raw.githubusercontent.com/forsakeninfinity/yomichan-data-exporter/release/dist/yomichan-data-exporter.min.js")
.then((resp) => resp.text())
.then((srcText) => {
eval(srcText);
})
.then(async () => await exportDatabase())
.catch((e) => console.error(e));
- If you run into errors for the above somehow, try the same steps as Chrome below.
- Open Yomichan’s setting page (click the gear icon from Yomichan’s popup)
- Open the web developer onsole
- Hit
F12
orCTRL + SHIFT + I
on Windows and Linux;CMD + OPT + I
on MacOS
- Hit
- Switch to the
console
tab - Unfortunately(?!), Yomichan released on Chrome doesn’t have permission to
actually inject code (I tried a whole bunch of different approaches and the
permissions are just lacking) so you are going to have to paste the contents
of the exporter code into the console.
It is a very long “one-liner” and apparently github is pretty bad at handling all of it being put into a code box so you may want to open the raw file, select all, then copy and paste into the console. Link to the raw.
- Finally, paste the following into the console and wait for the export + download to finish:
await exportDatabase();
You can actually import the exported dictionaries into existing installations of Yomichan, but it is going to require similarly annoying console one-offs.
Instead, I strongly recommend migrating to Yomibaba for the time being (and
eventually Yomitan) where there is first-class support for importing (and
exporting) this data in the Backup
section of the settings page. The UI there
should be self-explanatory, but refer to the Yomibababa repo’s documentation
and Yomibaba’s welcome page for more information.
- Source Repository: https://github.com/dexie/Dexie.js
- APACHE LICENSE: https://unpkg.com/browse/dexie@3.2.4/LICENSE
- Source Repository: https://github.com/dexie/Dexie.js/tree/master/addons/dexie-export-import
- APACHE LICENSE: https://unpkg.com/browse/dexie-export-import@4.0.7/LICENSE
- Source Repository: https://github.com/rndme/download
- MIT LICENSE: https://github.com/rndme/download/blob/master/LICENSE.md