User scripts without greasemonkey?

I know there’s a GM script that lets you fix a wrong answer (for situations like if you answered with a typo, or the wrong reading) but installing GM requires way too many browser permissions.

Does anyone have a JavaScript bookmarklet or something that would work as an alternative to a GM script?

Hope you don’t mind, I recategorized the post under “API And Third-Party Apps”, just for better chances of visibility to people who might be able to answer.

1 Like

The code is publicly available for each user script in greasemonkey, so you could technically make each one it’s own custom chrome extension. The only problem with that is that some user scripts require other scripts (like the WK Open Framework) to be loaded first which I’m not sure is controllable between chrome extensions.

But then those extensions would need too many permissions :scream:

Ok, so, I looked at how the WK for Android app does it (since Android’s WebView doesn’t support userscripts I thought it’d do something close to what you need).

You can find the code here: https://github.com/xiprox/WaniKani-for-Android/blob/master/WaniKani/src/tr/xip/wanikani/userscripts/IgnoreButton.java

The JavaScript code is: https://pastebin.com/EVztHEfB

image

I mean at that point you have complete control over the injected code that gets executed on the page (minus chrome’s stuff that is going to get executed regardless :tada:), so there really wouldn’t be any permissions for any external logic except for what you give yourself.

A bookmarklet might work too I guess. You would just take the JS from the userscript and put in into a bookmark that you would manually have to press to activate each script each time you go to do reviews, which doesn’t seem pleasant.

Tx for the pastebin link @jneapan .

Yep a JS bookmarklet is less convenient but giving a single extension (GM) permission to your entire browser is outside of my risk appetite.

P.S Thank you for your very useful and informative input to this conversation @DaisukeJigen

If you are paranoid about the extension being rogue you can inspect the source code, and then build and side-load it. Not very convenient of course, but it’s the price of being a sceptic :slightly_smiling_face:

Are you using Chrome? In Chrome you can force extensions to only work on specific sites. So while Greasemonkey (or Tampermonkey, the one I use) requires a ton of permissions, you can limit it to just wanikani.com.

5 Likes

Yeah I do. Didn’t know you can do that. Will go this route. Thanks!

2 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.