[Userscript] Audio during "Kana only Vocabulary" Reviews

Wanikani: Kana Vocabulary Review Audio

:warning: This is a third-party script/app and is not created by the WaniKani team. By using this, you understand that it can stop working at any time or be discontinued indefinitely.

Wanikani recently added Kana only vocabulary. The audio for these words operates slightly differently to other reviews. When you initially learn the word, the Japanese audio is played. However, when you are reviewing the word, you do not get to hear the Japanese again (as you only type the meaning, not the kana, which is what normally triggers playback).

This script autoplays the Japanese audio when you get the answer correct, so that you can associate the correct pronunciation with the meaning you have typed.


:point_right: Download it here :point_left:.

You also need a script host plugin like TamperMonkey (See General Script Installation instructions).


This is my first GreaseMonkey script, my first Wanikani script, and my first forum post. So I may not have done things 100% correctly. Everything works for me, but if you have issues please let me know and I’ll attempt to fix them! Also, thanks to those who wrote scripts that I was able to learn from, especially “Audio Tweak 4.0”.

2 Likes

I quickly looked at the code and there are a few things you could improve:

  • I see you are @matching the urls directly. WaniKani now uses turbo to load pages, you will see if you navigate to reviews from the dashboard your script won’t be loaded. I would recommend using the Turbo Events Library by inserio. WaniKani Open Framework now also has an on_pageload listener, although I haven’t really looked into it maybe @Inserio can weigh in on which to use.
  • The didAnswerQuestion event returns a lot of useful data, including whether or not you got it correct and all the subject details etc. You can use this to avoid doing all the querySelector shenanigans to get the info.

I recently wrote a script for reviews that includes these changes if you would like an example

2 Likes

Long story short, if you can get by with the on_pageload listener (which should be the case unless you need to use other events besides “turbo:load”), it’s the better option, since that means not needing to load the Turbo library too.

2 Likes