[Userscript] Item Difficulty Indicator 🟢🟡🟠🔴

Thanks! It appears that the setting is inverted to me. When it is unchecked, the difficulty appears in the info page.


1 Like

hey, im having weird bug, it does not update automatically the next grading, but when i open settings and change ‘box around indicator’ on and off it updates the rating. I’m using newest version of ghostery dawn browser (firefox fork)

1 Like

I sadly couldn’t make this any cleaner because the error message showing is handled by another script. Though I exchanged that message for the checkbox being deactivated (meaning it’s not clickable) when “In Item Info” or “Nowhere” is selected. This is much cleaner anyway in my opinion. Thanks for reporting it!

Oops, I noticed that before and thought I changed it already, sorry! I’ve gone right ahead and fixed that (although when you update now you might have to change the setting again :sweat_smile:). Thanks for telling me about it!

Hmm, weird. I checked in with compatibility with firefox and the way I do it should be supported by firefox. I’ve also gone ahead and implemented an extra layer to try to detect the item change so that it hopefully works for you now too, when you update the script. If it still doesn’t work just say so and I’ll look into it further!

:face_holding_back_tears::pray:

2 Likes

Thanks, I really like the idea behind this script! Unfortunately, I am facing more or less the same bug as @Elkyo.

I am running version 0.14 of the script (the latest to this date) using Firefox v. 107.0.1 and Tampermonkey. Here are some screenshots.

Review 毛 vocab item : the displayed difficulty level is 0 and will remain 0 for all upcoming items unless I go to the script settings

Open script setting window : the difficulty level is updated to level 1

Also, on startup of a review bunch, the difficulty level is not displayed until the script setting window is opened

I hope that this can help to improve the script.

1 Like

Hey again! I tried few diffrent settings together and now it works when I have the ‘Indicator Position for Reviews’ in the ‘In item info’ but it does not update the rating still on the ‘Beside the character’ option. If I recall correctly it wasn’t working there either so something got fixed. cheers

1 Like

Thanks for telling me!
Okay, so I installed firefox and found out there are some weird shenanigans going on that are slightly different to all the other browsers (probably because it’s not chromium-based). Anyway, I managed to fix them so that they worked on my firefox browser. Hopefully with version 0.15 they will work for you too!

Now, it should work for “Beside the Character” too, if you even want to change to that now!

3 Likes

I just updated and it seems that it works as a charm :+1:
Thank you so much :grin:

1 Like

Happy to hear that! :smile:

Hey I’m having the same difficulty mentioned above where it won’t refresh for the beside the character options, is it due to the fact I’m using a mobile browser? It’s safari on my iPad :thinking:

1 Like

Lemme try redownloading it first since you mentioned you updated it, sorry for the bother

1 Like

Did that fix your issue, or does it still persist?

Thanks for downloading!

It fixed the issue, thanks a bunch
I weirdly love being able to compare myself to everybody, it gives me a better reason to kinda try harder I guess

1 Like

Script did not load for me, had to add “https://www.wanikani.com/*” to match for it to load.
Apparently the wildcard for http(s) doesn’t work on chrome/macos.

Script doesn’t load at the same place too:
Kanji is at the top (which I like)

Vocabulary is at the bottom

1 Like

Thanks for reporting this!

I added “https” to the match because I don’t think “http” is needed anyway.
For the info pages I use WK Item Info Injector to inject the data and I think for vocab items the best I can do is putting it just under the “Meaning” section (which I’ve gone ahead and done).

These changes should be visible in the new version (0.16). If there’s something still not quite right please don’t hesitate to say it! :smile:

2 Likes

For the initial version of Item Info Injector this is true, but later I shoehorned some additional actions in which override the default positioning: appendAtTop(), appendAtBottom(), appendSideInfoAtTop(), appendSideInfoAtBottom(). You could use something like wkItemInfo.spoiling('nothing').appendSideInfoAtTop(...) to always have your section near the top.

3 Likes

Ah, wow! I missed that in the documentation (probably because I used your script so often already I didn’t think there would be any updates). Great that it’s now possible though. I’m going to use that, thank you very much!

2 Likes

I’m happy to hear that my library script is useful to other script authors! If you ever have a specific positioning in mind but don’t know how to achieve it with Item Info Injector feel free to ask me. As said before, some shoehorning took place in the past, so some parts have sadly become a bit more convoluted. [1]


  1. For example, the reason why I added .spoiling('nothing') to the code snippet above: .appendSideInfoAtTop() is only available for meaning and reading (because WK only splits up meaning and reading into the two columns during lessons and reviews), so at least “meaning” or “reading” has to be included in .under(). In the snippet, I omitted the under() selector, so it uses the full list of “composition, meaning, reading, examples”. However, if I would also omit the spoiling() selector, it would use “composition, meaning, reading, examples” here as well and assume that your info contains spoilers for any of these sections, leading to the section being initially hidden during reviews until the user expands the info to view both meaning and reading info.

    When I created Item Info Injector, I tailored it to the needs of a few selected scripts, but for other use cases it can become a bit clunky and/or hard to understand, so it’s best to just ask me when something does not immediately work. ↩︎

4 Likes

Yes, it’s incredibly useful! I’ve used it in a lot of scripts before, thanks for making it. I definitely will ask you directly next time :smiling_face: I guess that it becomes convoluted is quite unpreventable because of the way userscripts have to work around the structure of the website they can’t/shouldn’t change.

3 Likes

I just noticed a small bug: if I navigate to a kanji item page by going to this page and then clicking one of the kanji, the difficulty section does not appear. The problem is that WK has recently changed the item page navigation to avoid complete page reloads and instead uses ajax and history.pushState. Tampermonkey ignores this type of page navigation, so your script is not injected in this case. You could probably fix this for now by using

// @match        https://www.wanikani.com/radicals*
// @match        https://www.wanikani.com/kanji*
// @match        https://www.wanikani.com/vocabulary*

But maybe WK will also expand this navigation behavior to other parts of the website in the future.


Oh, and another problem I noticed: You @require Item Info Injector without the version number. The problem with this is that the default setting for Tampermonkey is to never check for updates for externals. It will only download a newer version of Item Info Injector if the URL has changed (e.g. if the version number in the @required URL has changed).

4 Likes

Oh, you’re right! I noticed something was off when I had to reload the page for the difficulty to appear but couldn’t quite figure out what it was.

I updated the @require too, thanks!

3 Likes