Using jStorage


Hey, this is my first time writing a tampermonkey script. I’m trying to use jStorage but I get an error when doing it.
What am I doing wrong?

1 Like

If jStorage is installed in the global scope you can just add /* global $ */ to remove the warning:

Although you can look into WaniKani Open Framework to handle storage

2 Likes

Thanks, but I still get the following error in the console:
Uncaught (in promise) ReferenceError: $ is not defined
It could be that jStorage is not installed? I’ve looked it up online but had trouble with it, how do I do it?

1 Like

jStorage isn’t available because you don’t actually have anything pointing to it as a dependency. You need to point to it with @require in the script header

3 Likes

Be careful with jStorage btw. As far as I know, WK has it pointing to session storage. So whatever you put in there will disappear very quickly.

1 Like

Thank you. I couldn’t find the jStorage dependencies, what should I actually write in the @require headers for jstorage? Thanks!!

2 Likes

That I don’t know - anywhere the script is hosted, I’d say. You could host it yourself, or look for a CDN that does. Or it could work if you just link to the file directly on Github:

https://raw.githubusercontent.com/andris9/jStorage/master/jstorage.min.js