Anki Forums

"reviewExtra" for plattform-independent insertion of JavaScript in the Reviewer

Looking through the code, I found this line, which makes it possible to inject a piece of Javascript into the “main skeleton” of the reviewer HTML.

However it seems this feature is not supported on any other Anki implementation.
One of my main gripes with writing JavaScript for Anki, is that I can’t preload anything, but have to load everything from the template text, making site performance a big issue. There are of course hooks for inserting JS, however hooks don’t work on other Anki platforms.

Having a way to insert JavaScript by writing to the collection config would alleviate this issue.

1 Like

AnkiMobile supports reviewExtra as well if I recall correctly. It’s not well documented at the moment because the collection config is sent on every sync currently, and I don’t want to encourage users to stuff hundreds of kilobytes of text into it until that can be fixed.

1 Like

I see that make sense, I can safely say that AnkiWeb reviewing does not support it (and neither does AnkiDroid).
But thanks for your feedback.