[Userscript] WaniKani External Definition from Weblio (JP) and Kanjipedia



Learning Alternative Correct Responses
Complementary study material for Kanji
Leech Squashing
Getting the most out of vocabulary lessons
Better immersion vocab script possibility
Source for better (ie, more Japanese-like) meanings?

CORS has to be done on the server side, so unless you control the server, the only option is to use a CORS Proxy. A proxy is a middle-man server that adds the headers needed to bypass CORS.

See [here], for example, though I haven’t tested this particular proxy.


Updated the screen for Kanji. Also removed する for the する verbs

If you need a proxy, delete Line 23

proxy = '';


Confirmed not to work



Works with GM_xmlhttpRequest (greasemonkey has better examples, same API).


Just as I am getting fucked by HTTP (Kanjipedia), but not HTTPS (Weblio). Works like a charm. Also works without ‘Disable Cross-Origin Restriction’.

BTW, it needs // @grant GM_xmlhttpRequest

Interestingly, it is GM_xmlhttpRequest, but GM.xmlHttpRequest. I use TamperMonkey on Safari, BTW.


Use @connect to whitelist domains by default and to avoid a spooky prompt window.

// @connect kanjipedia.jp
// @connect weblio.jp


Fixed the script to use observer() and MutationObserver. Please see if it still breaks.


Assuming you want to update new item:

$.jStorage.listenKeyChange(‘currentItem’, function(key, action) {
// do your stuff

jStorage documentation
Then you can just listen see if the info tab was opened or if whatever event you care about was triggered.
Anyways, doing this through jStorage might save you some sanity points.


Now, also added to lesson pages and item info pages.