[Userscript] Audio during "Kana only Vocabulary" Reviews

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