Skip to content

themoeway/yomichan-data-exporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yomichan Data Exporter

Background

Yomichan is a very cool pop-up dictionary for web browsers. However, it has been sunset.

Yomitan is a fork of Yomichan by TheMoeWay community which is actively maintained.

Migration from Yomichan to Yomitan is going to require people to be able to move their dictionaries (of which there could be numerous) from Yomichan into Yomitan. Yomichan lacks export support for dictionaries so people would have to track down the individual dictionaries they imported and re-import them. This has in fact been a sore point without concerning Yomitan as 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.

Yomitan supports exporting and importing the entire collection of dictionaries. However, 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/themoeway/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 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 Yomitan repo’s documentation and Yomitan’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

Contributors 4

  •  
  •  
  •  
  •