[Userscript] Niai 似合い Visually Similar Kanji

it’s a long shot, but did you ever find a solution to this?

I was having a problem where this script would collide with Katakana Madness and Open Framework, if those 2 are activated during lessons all of my answers would be marked as incorrect even when they’re correct.

To fix this and estevezj’s issue just disable Niai during lessons by editing the script and removing line number 11:

// @include *://www.wanikani.com/lesson/session*

then just click File and Save and that’s it, like mentioned before you don’t really need Niai during lessons that much, so for now this is enough until the script is fixed.

1 Like

I have recently installed this script and while the description indicates that you can see the similar kanji menu in both lessons and reviews I cannot see it in the Reviews, nor I could find a setting to change this behavior… Am I missing something? Or did something changed in the script?

1 Like

The script stopped working for me lately. I posted some more details in a separate thread.

same problem here, already had the Niai installed before, but suddenly it stopped working

I looked a bit into the problem of Niai and Keisei not working during reviews and lesson quizzes and updated a few outdated numbers in the code. It should work again if you update from here:

Niai update
Keisei update

@acm2010 I made a pull request with my changes – this is my first ever attempt at creating a pull request, sorry if I did something wrong.

Tagging the people that reported this problem

@wqreqewfd @ogirdor271 @Zwackelmann @Failnaught1


You’ve just re-improved my life immeasurably. :slight_smile: This is one of the most useful scripts I’ve installed.

1 Like

I recently reset my level. This script keeps highlighting items depending on my previous level. I cant for the life of me find a way to reset this. Any ideas?

I did not even realize until now that this script is supposed to use your WK level. That feature does not work for me at all – the script has set my level to 99 and therefore never displayed any items as locked. Just to make sure we are talking about the same thing: You do mean the diagonal hatching on the locked items, as in this screenshot?

yessir! i assumed the scripted worked based on your WK level. if i am missing setting somewhere or are being dumb i am sorry!

The script tries to load your WK level from the WK interface – specifically from the element li.levels a span:

this.settings.user_level = parseInt($(`li.levels a span`).text());

I have no idea where this element is/was – for me, Niai never found this element and has set my level to the default value of 99. When I created a bugfix for this script, I seem to have slightly messed up the CSS that adds the diagonal hatching, but I did not notice it because it did not work for me in the first place.

I can try to fix this functionality, but it might take a while. It seems that in the past, the script author of Niai tried to use wkof to determine which items are locked, but had to revert this change because for some users, the wkof loading popup repeatedly appeared. I will try to find out what was wrong, so that the wkof method can be re-enabled.

i am looking forward to your exploits, mr internet wizard man

I think I have fixed it – if you want, you can try out the new version here:

Install Niai with fixed “locked items” display

In this version, I have re-enabled the code that uses wkof (only if it is available) to fix the displayed item info. Instead of querying the WK items from wkof every time the Niai section gets displayed (which can happen very often during lessons and reviews), they are only requested once, which should prevent the wkof loading popup from appearing during the session.

If wkof is not installed, Niai now uses options["Current Level"] to determine the user’s level. Until today, I did not know that WK provides this information readily available.

1 Like

Ill try and report as soon as I can, thanks a bunch.

1 Like

Hey, I installed your fork, but it doesnt seem to work. Below in the screenie there it highlights words I used to have unlocked before the reset, but I am currently level 4 so ‘snow’ and ‘heavy’ should not highlight. I do have alot of scripts installed though, so that might interfere.

I assume you have WaniKani Open Framework installed?

Could you go to some WaniKani page, open the browser console (Ctrl+Shift+I) and paste the following code into the console?

await wkof.ready(`ItemData`);
let items = await wkof.ItemData.get_items({wk_items: {options: {assignments: true}}});
items.find(i => i.id === 673).assignments;

Then press Enter, expand the result, and post a screenshot of it (or copy the result as text). I would especially like to know what the srs_stage is, and what unlocked_at contains.

Example screenshot


Where exactly do I paste this? I only really have a filter bar there.
Looks like this:

I can set it to English if that helps you. Does this forum have DM or can I add you e.g. Discord, so we dont spam the thread?

Just below the yellow warnings and red error messages. Also, I think this thread is the appropriate place to spam about fixing bugs in the Niai script. And no need to change the language, I can read German just fine :slight_smile:

Wait, I just noticed something… if you use Ctrl+Shift+J to open the console in Firefox, it opens a different console than the one you should use. Why does Firefox have two different consoles!?

Use F12 instead. Or Ctrl+Shift+K (only in Firefox) to be immediately directed to the correct console tab.

Does anyone know whether acm’s 似合い Visually Similar Kanji script works on an Android device?