This in turn will make it possible to define a custom search keyword e.g. in Chrome so that you can e.g. type “wk”, then hit space and enter the term you want to search for:
Unfortunately, it’s not working for me (Firefox 64). The search string gets pasted into the search box, but after that the page reloads and WaniKani displays the error message “You are already signed in.”
Oh :-/
I have to admit that I only tested it in Chrome where it is still working fine. I will try to look into this but I have two other things on my list of things I promised to look into first and am somewhat busy at the moment so I can’t promise when I’ll get to it.
@irrelephant, not sure if you’re still around and maintaining scripts, but a small fix is needed due to changes WaniKani made a few months ago. Even though the search still executes, it doesn’t actually get displayed until you click the search icon (which makes the input and results visible). I added the following to the end of the submitSearch method to trigger the click event so the results show right away:
var searchButton = document.getElementById('search__trigger');
searchButton.click();
(Also, you should probably get rid of the console logs while you’re at it.)
var searchButton = document.getElementById('search__trigger');
searchButton.click();
to the end of the submitSearch method, but for me on Chrome Version 100.0.4896.127 (Official Build) (x86_64), the search doesn’t get executed either…
Obviously, coming after 2 years, it was likely not to work properly
Anyone has a clue ?
This script isn’t needed anymore since WaniKani made a dedicated search page several months ago. Just execute a search on WaniKani to see what the search URL looks like and then add a custom search engine to chrome.
Never mind it works with that now, maybe it’s an issue with the face I was on the IME still and so it wasn’t recognising the %s as the same characters.