I made a new version of the WaniKani KunOn script originally written by Rui Pinheiro (/t/Wanikani-KunOn-101-Kunyomi-or-Onyomi-instead-of-Reading-No-longer-supported/3883/1) because that one is not supported any more.
This one doesn’t import its own version of jQuery and doesn’t depend on the Grant None shim that was added to the old one. It uses some MutationObserver code to detect changes in the DOM and then checks the jStorage currentItem object to see if it is that which has changed. If it is it replaces the content of the question-type DIV. The MutationObserver code is from Stack Overflow (http://stackoverflow.com/questions/3219758/detect-changes-in-the-dom/14570614#14570614)
I got the idea to use MutationObserver from Ethan’s “Close, but no cigar” script (https://www.wanikani.com/chat/api-and-third-party-apps/7333).
A while ago I made an addition to my local copy of the original script because I wanted to have the question text in Japanese, so I have kept that option in this version. If you feel like having the question in Japanese edit the source in your Greasemonkey/Tampermonkey setting and change this line:
var strLang = “en”;
var strLang = “ja”;
The Japanese questions look like this.
The English questions are the same as the old version, the only thing that changes from standard is that it specifies on’yomi and kun’yomi for kanji instead of saying “Reading”.
Tested on the following:
Firefox 35.0.1 and Chrome 39.0.2171.95 (64-bit), Linux Mint 17.1 Cinnamon 64-bit
Firefox 35.0.1 and Chrome 40.0.2214.115 m, Windows 8.1 64-bit
I don’t have an Apple or Windows 7 so I can’t test it on those.
UPDATE Feb 25 2015Now applies to Lesson Quizzes as well as Reviews.
v 0.4.3 on Greasy Fork