[UserScript] WaniKani Quick Info

very useful, i hate this guy a lot… :@

Oh thank you, that sounds great. I’ll test it as soon as I can.

It works great. Thank you again Ethan.

This might be the best thing since over ride. Thank you so much! I just went through a large review pile and I didn’t rage at all!

Belayed thank you, but even after only 10 days of use, I can easily say this is seriously one of the most useful scripts I’ve used xD

Every time I go to do reviews on my phone I realize just how used to your script I’ve become ;D

Thank you SO much for this

It was my biggest pet peeve for the site - reviews could go so slow when the site’s clogged up, this’ll help

Ah sounds great! I really wish the ios WK app was being updated - I could really do with this on the phone.

Praise be to Ethan, the Bringer of Answers in a Timely Fashion.

Thanks to Ethan for this really nice UserScript.

I made my own version with a few bug-fixes and changes.
https://greasyfork.org/en/scripts/10063-wanikani-quick-info-kt

bug-fixes:
previous item display should now be impossible. (I think this can occur on stock WK, without any scripts...)
for me this only occurred under extreme lag, when you opened the info, gave up, answered the next question, opened the info, then old data showed up because the previous data request completed.
now it checks if the requested question is still the current question upon data request completion.

pressing space while waiting for data to load.
now things are not re-hidden on data load completion.
this bug was the primary reason I started meddling with this script.

fixed a bug in the original version where the data was getting re-requested upon hiding the pending info screen, not just upon displaying.
not sure what was causing this, but it doesn't seem to happen in this version.

other changes:
added User Synonyms to the waiting screen.

kobayashi said... Thanks to Ethan for this really nice UserScript.

I made my own version with a few bug-fixes and changes.
https://greasyfork.org/en/scripts/10063-wanikani-quick-info-kt

bug-fixes:
previous item display should now be impossible. (I think this can occur on stock WK, without any scripts...)
for me this only occurred under extreme lag, when you opened the info, gave up, answered the next question, opened the info, then old data showed up because the previous data request completed.
now it checks if the requested question is still the current question upon data request completion.

pressing space while waiting for data to load.
now things are not re-hidden on data load completion.
this bug was the primary reason I started meddling with this script.

fixed a bug in the original version where the data was getting re-requested upon hiding the pending info screen, not just upon displaying.
not sure what was causing this, but it doesn't seem to happen in this version.

other changes:
added User Synonyms to the waiting screen.
Great, those are all the fixes I was planning on looking at but never bothered to do :P 

EDIT: It doesn't seem to be working for me though :(
I've put a link to your script in the original post, but might still see if I can investigate the issues later anyway.
What part doesn't work?
I presume you mean the previous item display bug?

Are you using chrome?
And of course did you remember to disable the other version of the script?

I only tested this in firefox so far.


EDIT1:
You are right... testing on chrome, it does nothing. Behaves like no script.

EDIT2:
Well, found some interesting differences between Chrome and Firefox behavior.
For both original and my version, Chrome is calling additionalContent.itemInfo() before the script replaces it, so the original stock WK version is getting registered on the click handler. On your version at the end you call additionalContent.itemInfo() at the end of the script. That makes it work in chrome since otherwise the replacement function would never be called, but it also means that both the original function and the replacement function have registered different click handlers and both are getting called. Adding the additionalContent.itemInfo() to the end of my version gets it sort of working, but then a $("#additional-content-load").hide() is needed as you had in your version because the other click handler is calling $("#additional-content-load").show().

My version also experiences the sending extra requests on hiding bug with these changes. And in chrome the space bar don't re-hide fix is broken by the original function running.

Firefox does NOT call additionalContent.itemInfo() before the userscript replaces it, so there is only the replacement version running.
So that is why I did not encounter these problems before.

EDIT3:
Try it again on Chrome. I think it is fixed now.
Deleted all click handlers for the "#option-item-info" button.
This gets rid of the stock WK click handler that was causing problems.
Replaced two other necessary handlers that were deleted.
kobayashi said...EDIT3:
Try it again on Chrome. I think it is fixed now.
Deleted all click handlers for the "#option-item-info" button.
This gets rid of the stock WK click handler that was causing problems.
Replaced two other necessary handlers that were deleted.
The things you crazy kids get up to while I'm sleeping.
#downunder 

Consider changing the include to:
http*://www.wanikani.com/review/session*
It lets it work in both http and https, and in cases when garbage gets attached to the end of the url (?user-response=... etc).

Alright, Done. Seems harmless, maybe useful.
I didn’t think anyone could use http anymore.
But I tried it in firefox and it does let me use the site in http mode, and half my installed scripts drop out.
I vaguely recall it used to redirect to https even in Firefox.
Now alternatively my chrome has got some sort of sticky HTTP Strict Transport Security (HSTS) settings that make it always insta-redirect to https.
Never had a problem myself with end-of-url extra stuff on WK.

Hey, if either you @Ethan or @kobayashi are still working on this, I just confirmed that after the recent update that this script is what’s messing with how the UI displays user synonyms while doing reviews.

Would it be possible to fix that and push an update?

Posted an update.
Did that fix your issue?

I’ll do some reviews tonight and let you know! (Been out all day. With many children. So tired. Much knee pain. Ow.)

EDIT: Hey @kobayashi , so unfortunately that didn’t seem to fix the issue.


(You can’t see it well with this example, but it should be one synonym “ku” only.) This is of course assuming that the update was downloaded and installed automatically upon opening my browser, as I’ve had other greasemonkey scripts do. Is the code version of your script at the top of the code? If so I can check it to see if the update happened.

Here’s another example:
And another:

Thanks again for looking into this! : D

Updated the version at:

Top of the file should look like below if it’s running the most recent version.

// ==UserScript==
// @name          WaniKani Quick Info KT
// @namespace     https://www.wanikani.com
// @description   Shows available information while waiting for the server response. Originally by Ethan, Modified.
// @version       0.1.4
// @include       http*://www.wanikani.com/review/session*
// @run-at        document-end
// @grant         none
// ==/UserScript==

I tested this version in firefox and it seemed fixed for me.
I’ll try it in chrome later.

Definitely looks like it’s still broken for you.
Hopefully your still running the old version.

The loading animation icon should also be fixed.
I think that’s been broken for quite a while.

I just checked, I was running 0.1.3, so not the latest update. I’ll grab that now, and when I have a few more than 2 reviews, I’ll do them and get back to you. I have a pretty high percentage of synonyms, so if I get at least 10, I should see at least 1 in the mix. Especially since I just added some on my last session for being only slightly wrong.

EDIT: I too am using Firefox. And even after Viet and co. “sped up” the website, info was still usually quite slow, so I decided I’d rather have bad-looking (yet still functioning) synonyms and be able to check the info after getting something wrong, than not.

Hey @kobayashi, I just wanted to let you know I’ve had one item (a radical) with a synonym, and everything popped open quick and easy, and it was there looking perfect.

Thanks for the fix! : D

Found a bug with this script. Please refer to this thread:

Basically line 133 of kobayashi’s version needs to be updated to

emphReading = cur.emph === "onyomi" ? cur.on : (cur.emph === "kunyomi" ? cur.kun : cur.nanori);
1 Like