Skip to content

Just a quick and hacky way to export all of dictionaries from yomichan installations for importing in newer forks.

Notifications You must be signed in to change notification settings

forsakeninfinity/yomichan-data-exporter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yomichan Data Exporter

Background

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.

Steps to export the data

On Firefox

  • Open Yomichan’s setting page (click the gear icon from Yomichan’s popup)
  • Open the web developer onsole
    • Hit F12 or CTRL + SHIFT + I on Windows and Linux; CMD + OPT + I on MacOS
  • 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.

On Chrome

  • Open Yomichan’s setting page (click the gear icon from Yomichan’s popup)
  • Open the web developer onsole
    • Hit F12 or CTRL + SHIFT + I on Windows and Linux; CMD + OPT + I on MacOS
  • 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();

Steps to import the exported Yomichan dictionaries data

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.

Dependencies

dexie 3.2.4

dexie-export-import 4.0.7

downloadJS 4.21

About

Just a quick and hacky way to export all of dictionaries from yomichan installations for importing in newer forks.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%