Yet another Chrome Extension

Down in /t/Wanikanify-A-Google-Chrome-Extension/1000/35 Koichi-san mentions a possible chrome extension I had been a-contemplating since finding the original Furigana-Injector (https://chrome.google.com/webstore/detail/furigana-injector/cbahnmcliajmanjkaolemjelphicnein): just highlight the kanji I’m supposed to know in a page.

So, only blowing my rate limit once’t this evening, a somewhat crufty version that will try to do just that with your API Key, as an unpacked Chrome extension: https://github.com/nigelkerr/character-reminder  Please to try, and I certainly welcome feedback and pull requests and what have you.

It is not as who should say pretty at the moment, it does it to all pages indiscriminately at first load time,  it does not  handle pages that more text gets added to after first load, and error handling is terse and passive-aggressive at best. Input helpful.

an enormous shout out to Koichi  and Viet, without whose various valuable works I wouldn’t be here, and there wouldn’t even be a here here!

ナイゲル

EDIT 2012-12-12, 02:00: I am sorry that the first release was not working for people here.  I have a second release, the main change of which is to make it possible to just add your WaniKani API Key to the options page and not really need to do anything else. It is a little prettier.
EDIT 2012-12-24, 19:00: Release 0.7, in which highlighting can be toggled on and off with a page_action icon, and in which it has a snappier name, drawing on Level 4 vocabulary: 太字.

EDIT 2013-01-19, 02:00: Release 0.8, in which Chrome 24 is caught up to. Should be working now as previously under Chrome 24.

EDIT 2014-01-26, 13:00: Release 0.9, in which https is used to talk to WaniKani.

And still at  https://github.com/nigelkerr/character-reminder 

ナイゲル

I’m not sure if I can figure out how to get it working. I installed the unpacked extension, turned it on, put my API key in… but I don’t see any highlight. Is there anything I’m doing wrong / anything I need to do to try it out? Seems awesome! Can’t wait to see it develop!

You’re not alone, it doesn’t seem to work here either. I went to yahoo.jp just to check it out, and nothing was highlighted, but I did know some kanji on the page (btw it was the first time I did something like this, it was a pretty good feeling…:slight_smile: ).

Anyhow, it’d be great if it worked, I can’t wait to use it!

This is what i get for not thinking too hard about documentation! Let’s see if i can clarify.

So, starting from having installed the unpacked plugin in Chrome, first let’s see if highlighting works at all:
0. From chrome://chrome/extensions/
1. Go to the Options for the plugin
2. At the bottom here is a paragraph about “Enter any kanji not included elsewhere that you’d like to have high-lit.” and a text area.
3. Put a few choice, common Kanji in the text area
4. Press the Save button there
5. Visit something like 
http://ja.wikipedia.org/ to see if any characters are highlit in a pleasant dark pink

If that doesn’t work, then there is probably proof of the error of my ways on the Javascript console (View > Developer > Javascript Console), and I’d appreciate the report.

If that does work, we can move on to WaniKani:
0. From chrome://chrome/extensions/
1. Go to the Options for the plugin
2. Put your API Key in the first text box
3. First let’s press the “Check” button, which uses your API Key to get your User Info. If this succeeds, you’ll get a “howdy, SO_AND_SO”. In the background, we are also noting your LEVEL.
4. If that succeeded, let’s press the “Refresh” button.  This is calling Kanji urls from 1…LEVEL, and it ought to stuff the characters with stats at each level into the options page here for you to see, I have four rows.
5. Now press the Save button again.
6. Visit yer favorite page with Japanese to see highlit characters.

If some part of that doesn’t work, then the Javascript console again probably tells you about my failings.

The principle: only call the Wani Kani API from a direct user action (the buttons). So, it will only update the highlit Kanji when you ask it to, not every time.  At least, in this version. I’m imagining that a version that checked in no sooner than 24 hours or so might be better.

HTHよ

starting content.js                  content.js:7

That's all that logs into my console. I'm no javascript expert (actually I've never used javascript for anything else than cookie checking yet), but it seems like the script only gets that far, and the highlightKanji function never runs, since it doesn't have any output in my console, and it should. I didn't really check the code, only skimmed trough it ( read the first 3 lines or so) since I have lots of calculus to study, but it would seem like that's the problem.

I hope I could be of any help.

It’s working now, thank you :slight_smile:

Wow, wikipedia’s main page got a lot of purple. Thanks for the extension ^^

Works great. The main feature I would love to see implemented is a button to toggle to turn this feature off and on.

Also, here is a pic of a random wikipedia page for me: http://i.imgur.com/zeRqp.png ^^;

PS: An awesome side feature would be to be able to toggle all the kanji you DON’T know. That way you can see just how much of the page you don’t know yet. It’s especially useful when you start to get to the point where you know more than you don’t know.

Glad to hear it is working for more folks now!
Explicit toggling ought not be difficult to add.
Highlighting Kanji you don’t know, that ought not be too hard, neither.
Right this minute, one also has to visit the options page to get your known Kanji refreshed, and that I’d like to just happen every 24- or 48 hours or so.

cheers

Okay, I’ve got this working, but I had to revert from the dev channel to the stable channel of Chrome to get it working. Otherwise this is a great extension! Only request I have is that it would be nice to be able to change the color of the highlighted kanji.

This is awesome, I can see it being more and more gratifying the more levels you complete :slight_smile:

So it doesn’t autostart anymore? I have to click the button on every page I want it to highlight?

@Satoshi: yes, it’s got the button for highlighting and un-highlighting.  this means you have to take action each time.

maybe a setting to investigate: have it be manual, or have it be automatic.

naigeru said... @Satoshi: yes, it's got the button for highlighting and un-highlighting.  this means you have to take action each time.

maybe a setting to investigate: have it be manual, or have it be automatic.
 That would be great. I'm not gonna update for a while then :)

love the extension, but for some reason it has just stopped working for me.  its pulling all my info from WaniKani, but its no longer higlighting pages…

I can confirm that it has stopped working since Chrome 24.
I will have to figure out what I need to learn and change it for a new version.
Sorry for the interruption of service here folks!

I’m glad you’re working on it again, this extension is wonderful!

Ought to be working in Chrome 24 now, post if you have difficulties.

Thanks for the update, I only noticed it now. 

Please add the option to make it automatic again when you have the time. I love it when a webpage suddenly turns purple, it makes me feel like I actually know japanese :slight_smile:

I’m really not sure how to download this! I have a mac so I dont know if thats the problem. I downloaded the zip file and I dont know what to do next.