Oh cool. I just updated to 0.2.0 and it now does this.
Thank you!
Item Info does load, but Meaning and Reading arenât uncollapsed accordingly.
Also, Item Info Injector Userscript doesnât work alongside now, though I donât know if you can help with that.
If no undo button shows up, I wonder if itâs not being loaded. Can you check the following for me?
Thanks
Yes, I prioritized getting the info to show up first. Iâm not yet sure how to tell it which type to use.
Iâm not familiar with the item info injector userscript. I might glance at it to see where the conflict might be.
Regarding questionType
addEventListener('willShowNextQuestion', (e) => {
const { questionType, subject } = e.detail;
})
Item Info Injector is pretty fast to update â [For Userscript Authors] WK Item Info Injector - #32 by Sinyaven
That doesnât actually do anything with the question type information. It just puts it in a variable that is then never read.
But I do see a promising block in the item info controller:
enable = e=>{
const {
subjectWithStats: t,
questionType: s,
results: i
}
= e.detail;
if (this.showException(s, i), this.toggleTarget.classList.remove(this.toggleDisabledClass), this.toggleTarget.setAttribute('href', this.urlTemplate.replace(':id', t.subject.id)), this.autoOpenAfterIncorrectCountValue > 0) {
const {
meaning: t,
reading: s
}
= e.detail.subjectWithStats.stats;
!i.passed && (t.incorrect >= this.autoOpenAfterIncorrectCountValue || s.incorrect >= this.autoOpenAfterIncorrectCountValue) && this.toggleTarget.click()
}
};
More than setting subject ID on .additional-content__item--item-info
, probably you need to manually expand by [data-toggle-context-value]
Oh, that looks promising. Let me try that.
Thanks for the reply. I donât know what version of the script I had when I wrote that because it updated an hour ago to 0.2.0. With that version it still doesnât work and Iâm not being offered 0.2.1. Can I force an update?
Iâve had some issues getting some version updates, probably related to browser cache in some way. But you shouldnât need to get 0.2.1 for things to work well, 0.2.0 was also fairly stable.
In that case, I have 0.2.0 of the script, the original script is disabled and Wanikani Open Framework is version 1.0.60. In the web developer console, I can see references to the open framework but no mention of your script. However, looking at tampermonkey when Iâm on that page claims that both scripts are enabled.
I believe 0.3.0 opens the right section now. Thanks for helping dig in!
Well one last thingâŠ
Does the âwanakanaâ object exist in the console? Thatâs something I load with my script, so it should work for checking if my script loaded.
And to confirm, you donât get an undo button at all?
I donât get an undo button at all no. Not sure how to search for a particular object but I canât see âwanakanaâ in any of the output.
If you open the interactive console, you can type things at the bottom (known as a REPL, but I donât know your background) and evaluate them. The engine is JavaScript, so typing something like â2 + 2â and pressing âenterâ will evaluate to 4 and print the result for you to see. In the same vein, you can just type âwanakanaâ and hit âenterâ and see if the object exists.
But the fact that the undo button doesnât show makes me think that either the script isnât loading or something breaks in the initial load.
Actually, I wonder if itâs a conflict with another script? Can you disable all scripts except the open framework and my script and see if it works then? If it does you could go through and see which script is causing the conflict.
I loaded the item info injector and actually didnât have any issues. So maybe thereâs a conflict in a particular browser?
With just your script and the framework, I get âUncaught ReferenceError: wanakana is not definedâ but 2+2 =4
Okay. Then yeah, somehow my script isnât loading. Sounds like the matchers work because you get it as an option⊠Iâm not sure the cases where that would be happening, but you could try updating firefox and checking if you have any additional JS security settings in place?
Firefox is now version 111.0.1 and it now works \o/. The undo button is a little bit misaligned but it does the job. Thanks very much for your help, itâs much appreciated.
nvm, itâs an error in my script unrelated to Info Injector.
Item Info doesnât get collapsed on Undo.