Installing Wanikani Open Framework

Is it possible to have the following line added to the metadata at the start of the script:

// @weight 999

Some userscript software uses this to decide the load order. The number 999 being loaded first, and the number 1 being loaded last.

So something like this:

Screenshot 2022-08-03 at 23.12.54

2 Likes

Hi! Can’t seem to get some scripts to work (e.g. Double-Check).
Also don’t see the scripts menu icon, which makes me think that the issue is with Open Framework.

  • Using Chrome with TamperMonkey.
  • Wanikani Open Framework is set #1 in userscripts order.
  • Tried disabling adblock.
  • Tried setting Script Compatibility Mode on.
  • Tried disabling and reinstalling userscripts.
  • Tried reinstalling Chrome.
    The console:
    terterter

I keep hearing that there’s a bug in various versions of Chrome and/or TamperMonkey. To be honest, I haven’t been able to replicate the problem here, though I use Brave browser, which is Chrome with tracker-blocking built in.

Eventually, when I have a break in my schedule, I’ll try installing Chrome to see if I can replicate the problem. Until then, maybe try Brave or Firefox if you can.

2 Likes

Thanks for the reply. All works well with Firefox + TamperMonkey combo :slight_smile:
Good luck finding the cause of the problem!

I’m pretty sure my Wanikani Open Framework is failing to load on Firefox with ViolentMonkey. Only userscripts I have activated are Double Check and Rendaku Information. Is this a known issue?

The problem was reported before in a different thread:

It seems that Violentmonkey’s synchronous page mode uses a different injection method that still works, so you could enable this as a workaround. Or you could switch to Tampermonkey.

2 Likes

I’ve switched to Tampermonkey for now, thanks!

1 Like

I think there must have been a recent update to Firefox which is blocking the script via violentmonkey that is being worked around by tampermonkey. I found that if you enable synchronous load it will work on violentmonkey, although I ended up switching to tampermonkey as even with synchronous load on it would sometimes fail to load the script randomly which was annoying.

1 Like

I am wondering if there is a way to automatically check for new versions or do I have to do it manually? I’m only using Open Framework and Double check on an iPad with Userscripts since it doesn’t look like tampermonkey is supported for mobile Safari. Maybe I’m just ignorant.

I guess if it’s manual I’ll wait until it breaks - just trying to avoid a disaster in a review session.

I don’t know if Safari/iOS supports automatic updates. But have you looked into the Macaque app? I’m not an Apple user, but I’ve seen it recommended as an alternative for iPhone/iPad.

Thanks, I’ll keep it in mind. A minor victory today was noticing the update button in Userscripts. The documentation says it will ‘periodically’ check for updates to the scripts. I think @version, @updateURL and @downloadURL must be set, so I’ll see if they’re in the scripts already.

If you saw some documentation somewhere about that being a requirement for the apps/plugins you’re using, please point me to it and I’ll see about adding the necessary tags to my scripts.

It was in the readme for Userscripts Safari in the Metadata section:

Hi @rfindley, I’m a big fan and long time user of WK Open Framework, but it hasn’t been working for me in Chrome (on my new computer) for many months.

I was able to fix it by opening the Chrome Developer Tools and manually adding apiv2_key: my-api-key as a Local Storage entry as shown in this screenshot:

The above manual edit was necessary because the Apiv2.js parse_page function in the get_apikey function calls $(html), which results in a $ is not defined error in Chrome. I assume this is because jquery has not been loaded yet. The fix might be as simple as changing where, how, or in what order you load jquery.

Thanks for everything.

1 Like

Thanks for the heads-up. Yeah, I had removed the jquery dependency from most of WKOF back when WK started removing jquery. But it looks like I missed a few spots in Apiv2.js. I’m not sure when, but I’ll put that on the to-do list. Thanks!

2 Likes

ah, so I just had to update my user script from

wkof.include('ItemData');
await wkof.ready('ItemData');

to

// Jquery needs to be included to prevent wkof from crashing
// when apiv2_key is not already set in local storage
wkof.include('Jquery');
await wkof.ready('Jquery');

wkof.include('ItemData');
await wkof.ready('ItemData');

To get them to load in parallel…

wkof.include('ItemData, Jquery');
await wkof.ready('ItemData, Jquery');
2 Likes

That works great :+1:

this is amazing !

Is the title for this thread OK? Searching the forum (Search results for 'wanikani open framework' - WaniKani Community) doesn’t yield this thread easily.

It comes up with wkof, but it is confusing whether this is the right thread.

image

Also this thread doesn’t have [Userscript] in the title.