[UserScript] KanjiDamage mnemonics for WaniKani

It isn’t just Firefox. I’m on Chrome and I get this too. Happens either on a lesson, or when I go to an item’s page. The console is showing that the request is being blocked by client:

On a whim, i searched that error, and among the first results was adblock. I paused adblocker, and lo and behold, everything works.

@Aikibujin, If you’re running an adblocker, try disabling it on Wanikani, see if that helps.

It might also be privacy badger (or an extension like that)

Yeah that was it!

I run four different add blockers, so that was toasting it.

Cheers! ^ _ ^

1 Like

I’ve got an issue where the KanjiDamage mnemonics are visible when I go to the detailed kanji page, but not during the lessons. I’m using Violentmonkey on Firefox, the console shows this:

TypeError: right-hand side of 'in' should be an object, got null
  reviewMn https://www.wanikani.com/lesson/session:230:17
  updateThings https://www.wanikani.com/lesson/session:198:21
  observer</< https://www.wanikani.com/lesson/session:206:25
  forEach self-hosted:262:13 
  observer< https://www.wanikani.com/lesson/session:204:21

I tried disabling uBlock and Privacy Badger, but that didn’t help. Does anyone else have any suggestions?

try tampermonkey. its also available on firefox

Kanji page for some items with this script appears to me to be slightly brokey


The meaning section is all around the place. This happens because of conflicting ids “meaning”.

I dared to fix it and forked the script. Also I took liberty to slightly change the style to match lessons and reviews: KanjiDamage mnemonic is a child of Meaning section, not a sibling.

Modificated script

Just my little mod, it was interesting to tamper with userscript but if you like to you can try my fixes here https://github.com/memosiki/js-scripts/raw/master/KanjiDamage%20mnemonics%20for%20WaniKani.user.js

2 Likes

I remembered reading KanjiDamage a good several years ago, but then I installed this script and looked up a few Kanji I originally had trouble with the first time. Then I got this.

I love this script and thank you so much for making this. Some of these mnemonics really are a whole lot better.

3 Likes

i merged your changes. thanks for the fix

3 Likes

I thought you were dead :scream: so the thread. I actually contributed a lil bit, whoa

3 Likes

hey, great script. Ive been having the same issue as here. script wont run on lessons, but on the detailed kanji page. i get below error. im using tampermonkey on firefox and siabled anything that could be blocking it, such as ublock etc

i picked this from the console, but i have no idea what im doing

Uncaught (in promise) TypeError: mlocation is undefined
    tms_51f2bd55_f46c_436c_a3d1_213c42b18e09 moz-extension://875d41a5-b708-41a2-a0e9-4b4cb65c302d/userscripts/KanjiDamage mnemonics for WaniKani.user.js?id=51f2bd55-f46c-436c-a3d1-213c42b18e09:144
    l https://cdn.wanikani.com/assets/v03/lesson/application-430217ba60848b0ce37def6a409cbce2f61c88d5e90b562e620cf57d17cae578.js:25
    add https://cdn.wanikani.com/assets/v03/lesson/application-430217ba60848b0ce37def6a409cbce2f61c88d5e90b562e620cf57d17cae578.js:25
    ready https://cdn.wanikani.com/assets/v03/lesson/application-430217ba60848b0ce37def6a409cbce2f61c88d5e90b562e620cf57d17cae578.js:25
    tms_51f2bd55_f46c_436c_a3d1_213c42b18e09 moz-extension://875d41a5-b708-41a2-a0e9-4b4cb65c302d/userscripts/KanjiDamage mnemonics for WaniKani.user.js?id=51f2bd55-f46c-436c-a3d1-213c42b18e09:114
    tms_51f2bd55_f46c_436c_a3d1_213c42b18e09 moz-extension://875d41a5-b708-41a2-a0e9-4b4cb65c302d/userscripts/KanjiDamage mnemonics for WaniKani.user.js?id=51f2bd55-f46c-436c-a3d1-213c42b18e09:155
    s eval:4
    <anonymous> moz-extension://875d41a5-b708-41a2-a0e9-4b4cb65c302d/userscripts/KanjiDamage mnemonics for WaniKani.user.js?id=51f2bd55-f46c-436c-a3d1-213c42b18e09:1
    <anonymous> moz-extension://875d41a5-b708-41a2-a0e9-4b4cb65c302d/userscripts/KanjiDamage mnemonics for WaniKani.user.js?id=51f2bd55-f46c-436c-a3d1-213c42b18e09:1
    <anonymous> moz-extension://875d41a5-b708-41a2-a0e9-4b4cb65c302d/userscripts/KanjiDamage mnemonics for WaniKani.user.js?id=51f2bd55-f46c-436c-a3d1-213c42b18e09:156
    <anonymous> moz-extension://875d41a5-b708-41a2-a0e9-4b4cb65c302d/userscripts/KanjiDamage mnemonics for WaniKani.user.js?id=51f2bd55-f46c-436c-a3d1-213c42b18e09:158
    s eval:4
    t eval:3
    E_u eval:4
    create eval line 2 > Function:67
    create eval line 2 > Function:69
    c eval line 2 > Function:7
    s eval:4
    i eval line 2 > Function:5
    s eval line 2 > Function:5
    v eval:13
    v eval:13
    s eval:4
    t eval:12
    s eval:4
    h eval:12
    h eval:12
    send eval:13
    s eval line 2 > Function:5
    setTimeout eval line 2 > Function:6
    run eval line 2 > Function:8
    runListeners eval line 2 > Function:7
    anonymous eval line 2 > Function:70
    v eval:13
tms_51f2bd55_f46c_436c_a3d1_213c42b18e09 moz-extension://875d41a5-b708-41a2-a0e9-4b4cb65c302d/userscripts/KanjiDamage mnemonics for WaniKani.user.js?id=51f2bd55-f46c-436c-a3d1-213c42b18e09:155
    s eval:4
    <anonym> moz-extension://875d41a5-b708-41a2-a0e9-4b4cb65c302d/userscripts/KanjiDamage mnemonics for WaniKani.user.js?id=51f2bd55-f46c-436c-a3d1-213c42b18e09:1
    <anonym> moz-extension://875d41a5-b708-41a2-a0e9-4b4cb65c302d/userscripts/KanjiDamage mnemonics for WaniKani.user.js?id=51f2bd55-f46c-436c-a3d1-213c42b18e09:1
    <anonym> moz-extension://875d41a5-b708-41a2-a0e9-4b4cb65c302d/userscripts/KanjiDamage mnemonics for WaniKani.user.js?id=51f2bd55-f46c-436c-a3d1-213c42b18e09:156
    <anonym> moz-extension://875d41a5-b708-41a2-a0e9-4b4cb65c302d/userscripts/KanjiDamage mnemonics for WaniKani.user.js?id=51f2bd55-f46c-436c-a3d1-213c42b18e09:158
    s eval:4
    t eval:3
    E_u eval:4
    create eval line 2 > Function:67
    create eval line 2 > Function:69
    c eval line 2 > Function:7
    s eval:4
    i eval line 2 > Function:5
    s eval line 2 > Function:5
    v eval:13
    v eval:13
    s moz-extension://875d41a5-b708-41a2-a0e9-4b4cb65c302d/content.js:92
    s moz-extension://875d41a5-b708-41a2-a0e9-4b4cb65c302d/content.js:92
    n moz-extension://875d41a5-b708-41a2-a0e9-4b4cb65c302d/content.js:93
    (Async: setTimeout handler)
    setTimeout moz-extension://875d41a5-b708-41a2-a0e9-4b4cb65c302d/content.js:105
    processMessage moz-extension://875d41a5-b708-41a2-a0e9-4b4cb65c302d/content.js:109
    72 moz-extension://875d41a5-b708-41a2-a0e9-4b4cb65c302d/content.js:113
    init moz-extension://875d41a5-b708-41a2-a0e9-4b4cb65c302d/content.js:93
    s eval:4
    t eval:12
    s eval:4
    h eval:12
    h eval:12
    send eval:13
    s eval line 2 > Function:5
    setTimeout eval line 2 > Function:6
    run eval line 2 > Function:8
    runListeners eval line 2 > Function:7
    anonymous eval line 2 > Function:70
    v eval:13
    s moz-extension://875d41a5-b708-41a2-a0e9-4b4cb65c302d/content.js:92
    s moz-extension://875d41a5-b708-41a2-a0e9-4b4cb65c302d/content.js:92
    send moz-extension://875d41a5-b708-41a2-a0e9-4b4cb65c302d/content.js:93
    E moz-extension://875d41a5-b708-41a2-a0e9-4b4cb65c302d/content.js:116
    processQueue moz-extension://875d41a5-b708-41a2-a0e9-4b4cb65c302d/content.js:88
    r moz-extension://875d41a5-b708-41a2-a0e9-4b4cb65c302d/content.js:95
    (Async: EventListener.handleEvent)
    g moz-extension://875d41a5-b708-41a2-a0e9-4b4cb65c302d/content.js:96
    72 moz-extension://875d41a5-b708-41a2-a0e9-4b4cb65c302d/content.js:97
    72 moz-extension://875d41a5-b708-41a2-a0e9-4b4cb65c302d/content.js:117
    72 moz-extension://875d41a5-b708-41a2-a0e9-4b4cb65c302d/content.js:117
    t moz-extension://875d41a5-b708-41a2-a0e9-4b4cb65c302d/content.js:1
    <anonym> moz-extension://875d41a5-b708-41a2-a0e9-4b4cb65c302d/content.js:2
    <anonym> moz-extension://875d41a5-b708-41a2-a0e9-4b4cb65c302d/content.js:2
    inject resource://gre/modules/ExtensionContent.jsm:575
    InterpretGeneratorResume self-hosted:1482
    AsyncFunctionNext self-hosted:692

having the same issue, using chrome and tampermonkey. The mnemonics didn’t show up on lessons, but it shows up on reviews and individual kanji page. Already tried disabled all scripts and tried using firefox and edge still didn’t work

@morczubel @hilmyaas WK has recently updated the lesson page, and that change breaks this script. If you want, you can try out my fork of this userscript: Install from my fork

The forked version is also more secured against XSS attacks, but this change was probably unnecessary because Kanji Damage is likely trustworthy, and the fetched pages are actually stored on https://grenzionky.github.io, which I assume is under the control of the script author. The forked version only handles a small subset of HTML tags, so some stuff might be missing.

Alternatively, you can use the script compatibility mode, which can be activated in the WK settings.


EDIT: Updated my fork – it now handles all occurring HTML tags, except for <table>-related tags (which seemed unnecessary) and the one embedded YouTube video on the page for 派 (which seems to have been removed from YouTube anyway).

3 Likes

thanks! will give this a try once i leveled up

I have turned on compatibility mode and that made it work fine! thanks for the tip.

Are there any blatant downsides to this? i run a few scripts so i think im a candidate for it (I usually slap like 400 mods ontop of my skyrim aswell lmao)

The only downside I can think of is that the compatibility mode only delays the breaking change, and one day this change will also reach the compatibility mode (at least that is how I understand it – you can read the official post about the compatibility mode here).

I think the intended use of the compatibility mode is:

  1. Notice that some of your installed userscripts don’t work anymore.
  2. Report the problem in the respective threads.
  3. Activate the compatibility mode so that you can still use the scripts while the script authors hopefully try to fix them.
  4. Every once in a while, check if the scripts were fixed, and if they were, disable the script compatibility mode so that you are using the up-to-date version of WK.
1 Like

want to confirm using your fork today for lessons and the kanjidamage mnemonics shows up now :grin:

1 Like

If someone has a fork they want to maintain please create a new thread for it. I am marking it as outdated in the list

The script author actually accepted my 6 months old github pull request two weeks ago. However, they did not update the script available at OpenUserJS, so the version linked in the OP is still broken. Considering the slow response time, I’m wondering if I should even bother them to also update their OpenUserJS script.

Anyway, I did not publish my version of this script in a new thread because of the pending pull request. And partly also because I have never used KanjiDamage but have heard that it might contain some controversial mnemonics, so I would have preferred to not have the script published under my name just to avoid any potential problems. But now that the pull request took forever and did not even fix the OpenUserJS version, I’m wondering if maybe the best solution really is to resort to creating a new thread.


And thank you for cleaning up the list of userscripts. :slight_smile:

1 Like

I have now created a new thread for my maintained version of this script.

1 Like