[Userscript] Wanikani Katakana For Onyomi

So, I took a look and I don’t think I will be adding compatibility, at least not soon. Ankimode disables and replaces the standard input field with its own version to display and directly inserts the correct answer, whereas this script reacts whenever something is typed in the standard input field. It would probably be possible to align them, but I can’t really think of a good way to do it.

Thanks for troubleshooting the issue, I will add this incompatibility as a known issue.

Ok, thank you for having taken a look anyway :blush:

About the overviews and the infopages, do you think something can be done to display the Onyomis in katakana?

Seems this is no longer working perfectly due to an update. If you load the dashboard and then navigate to a review page, the script will not load. Workaround is to refresh the browser on the review page.
Seems to also work if you remove the following two lines from the script
// @exclude https://www.wanikani.com/dashboard
// @exclude http://www.wanikani.com/dashboard
but I am on vacation so I can’t properly test or deploy a fix this week.

Edit: Update pushed.


It looks like this userscript is not working anymore for me. I’ve also tried to turn off other userscripts I have installed, but it’s still not working. I am on Chrome and I’m using Tampermonkey.

Strange. Could you open the browser debug window, select the console tab, and paste the contents here? Preferably while using only this script.

Edit: Hmm, now I got a similar problem myself, but it went away when I tried to track it down. The console complained about too much recursion. No idea what that’s about.

Hi Harald1, thank you for your reply.
I updated the script to version 2.4.3 and it is working now, also combined with other userscripts (it works also with auto-commit by fixing that script in this way). Apparently I only had installed version 2.0.0 :sweat_smile:

Hey just as a quick info for anyone wanting to use the script together with flick input on the phone, as it makes you unable to write kana with dakuten, handakuten or small kana.

I just changed the “input” classifier from the EventListener in row 47 to “blur” to only convert it after you finished typing everything.

Maybe this also works for hiragana input on pc, haven’t tested it though.

I realized that the on’yomi readings are still shown in hiragana when you search for a kanji outside of reviews and lessons. Would it be possible to make them into katakana too?

Maybe the script just needs to be applied at those pages or maybe it’s more difficult to make this change.

It should definitely be possible, but I ran into some trouble trying to make it work with the navigation framework wk uses. A few dozen posts up in the thread someone posted a 4 line addition to the script that makes it work on kanji pages, but it only works if you refresh the page, or navigate to the page from outside wk. This is about as far as I managed to get it to work as well.

I keep thinking I’ll look into it next vacation, but somehow there’s always more fun things to do than code javascript for a feature I personally never use.

You’re not the first person to request it, so there’s definitely a demand.

Preview of next update, only change is support for the individual kanji pages. Will likely push this to greasyfork in a week or so if I don’t notice any issues. // ==UserScript==// @name WaniKani Katakana For On'yomi// @author - Pastebin.com

Turned out that I just needed to handle this page the same way as the lesson page. I’d like to add on’yomi to the new recent mistakes widget, and the kanji overview page, but I think I’d have to hardcode the primary reading of every single kanji on wk for that, and it’s a lot of work and ongoing maintenance.

As the row where you need to change ‘input’ to ‘blur’ in the event listener changed with the update, I wanted to share a screenshot for anyone who wants to make this userscript work with flick-input on the phone.

Just change the highlighted word at this place to the one shown in the photo:

On the kanji pages there seems to be an extra line break before the onyomi reading. Is it just on my end?

I see it too.

I really don’t get it, somehow the line breaks are there when I get the event from the site of what’s about to be displayed. But it also only happens if this script is activated so clearly I am the cause somehow.

Hmm ok that’s weird. But maybe you can filter out the line break as a hot fix?

Oh btw, if I reload the page the extra line break is gone.

This would be a working hotfix.

But I have no idea where the line breaks come from.

I deployed a quick fix, and nothing is ever as permanent as that :confused:

It’s broken now since some update by WK yesterday.

What’s worse it glitches the lessons when moving to the “reading” section, and it can’t be fixed by simply disabling the script, you have to disable the script, sign out and sign back in.

Not sure I understand the problem. Is it the “add note” flickering when moving between reading and meaning?

And no audio. You can actually see an error in the console regarding the audio

AbortError The play() request was interrupted by a call to pause().

I am only able to reproduce this issue if I refresh the page while the “reading” is open. Refreshing the page at any other point, or navigating “normally” seems to produce no issues.

It also happens for me if I disable the script, and refresh in this specific scenario. So it seems to be a wanikani problem to me.